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

Dj Gilcrease digitalxero at gmail.com
Sun Nov 8 13:31:09 EST 2009


On Sun, Nov 8, 2009 at 11:15 AM, Wells <wells at submute.net> wrote:
> I'm not quite understanding why a tuple is hashable but a list is not.
> Any pointers? Thanks!

tuple is hashable because it is immutable whereas a list is mutable.



More information about the Python-list mailing list