[issue28193] Consider using lru_cache for the re.py caches

Raymond Hettinger report at bugs.python.org
Sun Sep 18 17:07:48 EDT 2016


Raymond Hettinger added the comment:

Yes, I saw that.  If a function could raise a NoCache exception,  re._compile() could take advantage of it.  But I don't feel good about going down that path (adding coupling between the caching decorator and the cached function).  It would be better to keep the lru_cache API simple.  I already made the mistake of expanding the API for typed=True just to accommodate a single use case (re.compile).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28193>
_______________________________________


More information about the Python-bugs-list mailing list