[issue9685] tuples should remember their hash value
Tim Peters
report at bugs.python.org
Wed Aug 25 22:00:04 CEST 2010
Tim Peters <tim.peters at gmail.com> added the comment:
- Tuple objects don't currently reserve space to store their hash code, so it's likely this would increase the size of every tuple.
- It's unclear to me which natural use patterns would actually enjoy a major speed boost. Note that dicts remember the hash codes of keys already, regardless of whether the key type remembers them too. A tuple is typically constructed right before being used in a dict lookup, so for a one-shot use no time would be saved. If the new tuple is used in multiple dict lookups, sure - but is that common?
----------
nosy: +tim_one
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9685>
_______________________________________
More information about the Python-bugs-list
mailing list