Tuples vs Lists: Semantic difference (was: Extract String From Enclosing Tuple)

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Thu Mar 1 06:02:36 EST 2007


George Sakkis, I agree with the things you say.
Sometimes you may have a sequence of uniform data with unknown len (so
its index doesn't have semantic meaning). You may want to use it as
dict key, so you probably use a tuple meant as just an immutable list.
I don't know Ruby, but I think it allows such purposes with a freezing
function.

Bye,
bearophile




More information about the Python-list mailing list