Message151701
On Fri, Jan 20, 2012 at 7:58 AM, STINNER Victor
> If the hash output depends on an argument, the result cannot be
> cached.
They can still be cached in a separate dict based on id, rather than
string contents.
It may also be possible to cache them in the dict itself; for a
string-only dict, the hash of each entry is already cached on the
object, and the cache member of the entry is technically redundant.
Entering a key with the alternative hash can also switch the lookup
function to one that handles that possibility, just as entering a
non-string key currently does.
> It would require to add an
> optional argument to hash functions, or add a new function to some
> (or all?) builtin types.
For backports, the alternative hashing could be done privately within
dict and set, and would not require new slots on other types. |
|
Date |
User |
Action |
Args |
2012-01-20 17:42:07 | Jim.Jewett | set | recipients:
+ Jim.Jewett, lemburg, gvanrossum, tim.peters, barry, georg.brandl, terry.reedy, gregory.p.smith, jcea, mark.dickinson, pitrou, vstinner, christian.heimes, benjamin.peterson, eric.araujo, grahamd, Arfrever, v+python, alex, zbysz, skrah, dmalcolm, gz, neologix, Arach, Mark.Shannon, eric.snow, Zhiping.Deng, Huzaifa.Sidhpurwala, PaulMcMillan, fx5 |
2012-01-20 17:42:07 | Jim.Jewett | link | issue13703 messages |
2012-01-20 17:42:06 | Jim.Jewett | create | |
|