Why are tuples immutable?
Roel Schroeven
rschroev_nospam_ml at fastmail.fm
Wed Dec 15 09:18:21 EST 2004
Antoon Pardon wrote:
> Op 2004-12-15, Fredrik Lundh schreef <fredrik at pythonware.com>:
>>sorry, but I don't understand your reply at all. are you saying that dictionaries
>>could support mutable keys (e.g lists) by making a copy of the key? how would
>>such a dictionary pick up changes to the original key object? (I'm talking about
>>the key stored in the dictionary, not the key you're using to look things up).
>
>
> You want to mutate a key that is within a dictionary?
No, we don't want to mutate it; as far as I know, that is exactly the
reason why dictionaries don't support mutable keys.
--
"Codito ergo sum"
Roel Schroeven
More information about the Python-list
mailing list