[issue28239] Implement functools.lru_cache() using ordered dict

Raymond Hettinger report at bugs.python.org
Thu Sep 22 02:23:35 EDT 2016


Raymond Hettinger added the comment:

> I don't suggest to change lru_cach() implementation just now

For now, I would like to have this closed.  It doesn't make sense at the current juncture (with the compact being new, being in flux, and not having guaranteed ordering semantics).

Also, we should have a strong preference for loose coupling and high cohesion.  The lru cache code is principally about tracking recent and should maintain primary responsibility for the action, and the dictionary implementation should be primarily about a clean mapping implementation without having code baggage just for the lru).  

Besides that, there isn't much motivation for change.  The existing code is very good (clear, fast, decoupled, cohensive, and doesn't have compaction issues for cache hits).

----------

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


More information about the Python-bugs-list mailing list