Message157720
| Author |
pitrou |
| Recipients |
Jim.Jewett, Jimbofbx, Ramchandra Apte, jcea, pitrou, rhettinger, serhiy.storchaka, skrah |
| Date |
2012年04月07日.10:19:55 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1333793995.9.0.0277489989882.issue14478@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
> I recommend that __hash__ should use functools.lru_cache for caching.
Why would you do such a thing? A hash value is a single 64-bit slot, no need to add the memory consumption of a whole dictionary and the runtime cost of a LRU eviction policy when you can simply cache the hash in the object itself (like we already do for strings)... |
|