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.

Author rhettinger
Recipients Wouter De Borger2, kj, nanjekyejoannah, pablogsal, python-dev, rhettinger
Date 2021-06-05.00:06:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1622851597.82.0.205006595097.issue44310@roundup.psfhosted.org>
In-reply-to
Content
I'm thinking of a more minimal and targeted edit than what is in the PR.   

Per the dev guide, we usually word the docs in an affirmative and specific manner (here is what the tool does and an example of how to use it).  Recounting a specific debugging case or misassumption usually isn't worthwhile unless it is a common misconception.

For strong versus weak references, we've had no previous reports even though the lru_cache() has been around for a long time.  Likely, that is because the standard library uses strong references everywhere unless specifically documented to the contrary.  Otherwise, we would have to add a strong reference note to everything stateful object in the language.

Another reason that it likely hasn't mattered to other users is that an lru cache automatically purges old entries.  If an object is not longer used, it cycles out as new items are added to the cache.  Arguably, a key feature of an LRU algorithm is that you don't have to think about the lifetime of objects.   

I'll think it a for a while and will propose an alternate edit that focuses on how the cache works with methods.  The essential point is that the instance is included in the cache key (which is usually what people want).  Discussing weak vs strong references is likely just a distractor.
History
Date User Action Args
2021-06-05 00:06:37rhettingersetrecipients: + rhettinger, python-dev, pablogsal, nanjekyejoannah, Wouter De Borger2, kj
2021-06-05 00:06:37rhettingersetmessageid: <1622851597.82.0.205006595097.issue44310@roundup.psfhosted.org>
2021-06-05 00:06:37rhettingerlinkissue44310 messages
2021-06-05 00:06:36rhettingercreate