list vs tuple for a dict key- why aren't both hashable?

Tycho Andersen tycho at tycho.ws
Sun Nov 8 19:33:12 CET 2009


On Sun, 8 Nov 2009, Wells wrote:

> I'm not quite understanding why a tuple is hashable but a list is not.
> Any pointers? Thanks!

The keys of a dict have to be immutable. Lists are mutable, tuples are
not.

\t



More information about the Python-list mailing list