Death to tuples!
Fredrik Lundh
fredrik at pythonware.com
Tue Nov 29 04:36:00 EST 2005
Paddy wrote:
> I would consider
> t = ([1,2], [3,4])
> to be assigning a tuple with two list elements to t.
> The inner lists will be mutable but I did not know you could change the
> outer tuple and still have the same tuple object.
you can't.
but since hash(tuple) is defined in terms of map(hash, t), the resulting
tuple is not hashable.
also see:
http://effbot.org/zone/python-hash.htm#tuples
</F>
More information about the Python-list
mailing list