Antoine Pitrou added the comment:
Does this work for you?
>>> class X:
... @property
... @functools.lru_cache(None)
... def get_x(self):
... print("computing")
... return 5
...
>>> x = X()
>>> x.get_x
computing
5
>>> x.get_x
5
----------
nosy: +pitrou, serhiy.storchaka
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue21145>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com