This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Unsupported provider

classification
Title: LRU Cache with maxsize=None
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 3.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ncoghlan Nosy List: ncoghlan, rhettinger
Priority: low Keywords: patch

Created on 2010-12-01 01:01 by rhettinger, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
cache2.diff rhettinger, 2010-12-01 01:07 Support maxsize=None
Messages (3)
msg122967 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2010-12-01 01:01
Nick, I may have found a straight-forward way to incorporate your idea for the cache to support maxsize=None.  Let me know what you think.
msg122969 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2010-12-01 01:35
Nice!

You may still need to use the lock even for the simple unbounded case though - incrementing hits and misses isn't atomic, so the statistics may be miscounted if you get a hit or miss in different threads at the same time.

Alternatively, we could just document the hit/miss statistics as approximate figures for tuning purposes rather than guaranteeing 100% accuracy in all situations.
msg122977 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2010-12-01 03:46
Applied in r86911.
History
Date User Action Args
2022-04-11 14:57:09adminsetgithub: 54802
2010-12-01 03:46:15rhettingersetstatus: open -> closed
resolution: fixed
messages: + msg122977
2010-12-01 01:35:59ncoghlansetmessages: + msg122969
2010-12-01 01:07:51rhettingersetfiles: - cache.diff
2010-12-01 01:07:46rhettingersetfiles: + cache2.diff
2010-12-01 01:01:44rhettingercreate