Tuple Format?

Martijn Faassen m.faassen at vet.uu.nl
Tue Sep 5 09:44:39 EDT 2000


Gene C <gchiaramonte at yahoo.com> wrote:
>> Why use tuples at all?  The Pythonic way to enforce usage restrictions is
>> through convention:
>>
>> a = [1, 2, 3] # Do not modify this object!

> It's settled. Don't use tuples, they are evil! ;-)

Hah, I like tuples! I'm evil! Using lists for tuples is silly, they're just 
conceptually different things. A tuple is a lightweight structure, a
list is a list of stuff. You loop through lists, you rarely loop through
tuples. You tend to unpack tuples, and you rarely unpack lists. While
these usages are not enforced (in good Python style), the different ways
you use them actually makes tuples and lists far more different 
conceptually than they are different in their implementations.

Some more general mechanism for immutability sounds nice, though, but I
don't have the experience yet to know yet whether it is *wise*.

Regards,

Martijn
-- 
History of the 20th Century: WW1, WW2, WW3?
No, WWW -- Could we be going in the right direction?



More information about the Python-list mailing list