When are immutable tuples *essential*? Why can't you just use lists *everywhere* instead?

Bruno Desthuilliers bdesth.quelquechose at free.quelquepart.fr
Sat Apr 21 15:22:41 EDT 2007


seberino at spawar.navy.mil a écrit :
> Please help me think of an example where immutable tuples are
> essential.

Well, I don't know if they are "essential" - much of Python can be seen 
as 'unessential' syntactic sugar (my, even the class statement is not 
"essential" if you go that way).

> It seems that everywhere a tuple is used one could just as easily use
> a list instead.

Ever tried using a list as key in a dict ?




More information about the Python-list mailing list