You can use a global WeakKeyDictionary keyed by the object to achieve the same 
without having anything on the object.

    On Friday, October 16, 2020, 09:37:05 AM GMT+1, Ram Rachum 
<[email protected]> wrote:  
 Did you mean like keeping a hidden attribute on the object with the result? 
Well, that'd require manually keeping track of these attributes for each method 
I'm caching. I do that sometimes, but it's verbose. 

  
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/3IFTOHP6GRMEMY5KS2B4LDGXL5IZULZO/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to