943,973 Members | Top Members by Rank

Ad:
  • Python Discussion Thread
  • Marked Solved
  • Views: 946
  • Python RSS
Oct 28th, 2006
0

tuples and lists

Expand Post »
So if I want to store a list of items (such as a bunch of instances of a class), what's better to use: tuples or lists? I understand that lists are mutable, so what are the advantages to tuples?
Last edited by LaMouche; Oct 28th, 2006 at 6:57 pm.
Similar Threads
Featured Poster
Reputation Points: 83
Solved Threads: 39
Posting Whiz in Training
LaMouche is offline Offline
263 posts
since Oct 2006
Oct 28th, 2006
0

Re: tuples and lists

Tuples are great for constants because you won't accidently change them, they're also faster and use less space then lists, iirc.
Reputation Points: 10
Solved Threads: 3
Newbie Poster
Zonr_0 is offline Offline
16 posts
since Oct 2006
Oct 29th, 2006
0

Re: tuples and lists

Zonr is right, that is what a tuple is for! You want to preserve the integrity of your data here.
Moderator
Reputation Points: 1333
Solved Threads: 1403
DaniWeb's Hypocrite
vegaseat is offline Offline
5,792 posts
since Oct 2004

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Python Forum Timeline: Launch IE from python?
Next Thread in Python Forum Timeline: classes, functions, or globals for cycle calculator





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC