On Thu, 15 Oct 2020 at 19:14, Ram Rachum <r...@rachum.com> wrote: > > Your use case is valid, there are times in which I'd like a strong reference > to be kept. But there are also lots of times I want it to not be kept. Then I > would offer this feature as a flag `weakref=True` with a default of `False`. > What do you think?
I'd like to know what your use cases are. The key point is the comment from ed...@211mainstreet.net "Usually when I use lru_cache I don't want items to randomly disappearing from the cache". Your response is to make your desired behaviour optional, but you still haven't explained why it's needed in the first place. (To be clear, I'm -1 on the proposal anyway, as Chris Angelico said, building your own solution (or continuing to use the one you said you already had) seems like a fine solution to me, and having items get lost from the cache just because they were weakly referenced sounds to me like a bug magnet unless you know exactly what you're doing, even if people have to opt into it). Paul _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/GWUCDA22GWPESQ2QCYMPYOWLPZZC36WG/ Code of Conduct: http://python.org/psf/codeofconduct/