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

Fuzzyman fuzzyman at gmail.com
Fri Apr 20 18:18:09 EDT 2007


On Apr 20, 6:09 pm, Bjoern Schliessmann <usenet-
mail-0306.20.chr0n... at spamgourmet.com> wrote:
> seber... at spawar.navy.mil wrote:
> > Please help me think of an example where immutable tuples are
> > essential.
>
> When used as dictionary keys (also everywhere else where they must
> be in a constant order).
>
> Yes, this *is* used in practice.
>

Yup - using tuples as dictionary keys is very common.

Fuzzyman
http://www.voidspace.org.uk/python/index.shtml

> Regards,
>
> Björn
>
> --
> BOFH excuse #14:
>
> sounds like a Windows problem, try calling Microsoft support





More information about the Python-list mailing list