I have a silly question:
Why does Python have both Tuples and Lists?

The only programmer-visible difference, of which I am aware, between
them is that Tuples are immutable and Lists are mutable, with the
following implications:
1. Tuples can be used as hash (Dict) keys, and Lists cannot.
2. When you modify a Tuple, a new Tuple is created.  On the other hand,
List modification happens in place.

I don't see why is the above difference good enough reason to have
different notations for Tuples and Lists.
                                           --- Omer
-- 
Every good master plan involves building a time machine.  Moshe Zadka
My own blog is at http://www.zak.co.il/tddpirate/

My opinions, as expressed in this E-mail message, are mine alone.
They do not represent the official policy of any organization with which
I may be affiliated in any way.
WARNING TO SPAMMERS:  at http://www.zak.co.il/spamwarning.html

_______________________________________________
Python-il mailing list
[email protected]
http://hamakor.org.il/cgi-bin/mailman/listinfo/python-il

לענות