suggestions for using tuples instead of list (or vice versa)

Thorsten Kampe thorsten at thorstenkampe.de
Thu Apr 29 08:30:14 EDT 2004


I found out that I am rarely using tuples and almost always lists
because of the more flexible usability of lists (methods, etc.)

To my knowledge, the only fundamental difference between tuples and
lists is that tuples are immutable, so if this is correct, than list
are a superset of tuples, meaning lists can do everything tuples can
do and more.

Is there any advantage for using tuples? Are they "faster"? Consume
less memory? When is it better to use tuples instead of lists and when
better to use lists instead of tuples?

Thorsten



More information about the Python-list mailing list