[New-bugs-announce] [issue13227] Option to make the lru_cache type specific
report at bugs.python.org
Thu Oct 20 00:06:36 CEST 2011
New submission from Raymond Hettinger <raymond.hettinger at gmail.com>:
Based on a comment from Andrew Koenig, it is suggested that the lru_cache() offer an option to become type specific so that equal objects of different typed don't get cached to the same entry.
Here's an example:
return x * x
for x in [3, 3.0, 3, 3.0]:
Without type specificity, all four calls will return 9 rather than 9. 9.0, 9, 9.0.
First-pass patch attached.
components: Library (Lib)
title: Option to make the lru_cache type specific
type: feature request
versions: Python 3.3
Added file: http://bugs.python.org/file23473/typed_lru.diff
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce