Marten Lienen <marten.lie...@gmail.com> added the comment:

Central control over the cache and its parameters is definitely a big plus. In 
my use case, the objects hold references to large blocks of GPU memory that 
should be freed as soon as possible. Additionally, I use cached_method to cache 
expensive hash calculations which the alternatives cannot do because they would 
run into bottomless recursion.

Caching methods looks to be significantly more complex than caching functions 
because there are multiple possible priorities, e.g. fast gc, performance, 
cross-instance cache hits, caching __hash__. Do you think, in the face of these 
ambiguities, that the stdlib should potentially just not cover this? Though 
there is already the shared, global cache alternative in applying @lru_cache to 
a method.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue45588>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to