
Cached properties are trivially implemented class C: @property @lru_cache(None) def p(self): ... On Thu, Aug 20, 2015 at 11:57 AM, Sven R. Kunze <srkunze@mail.de> wrote:
On 20.08.2015 17:31, Thomas Güttler wrote:
The following solution provides an @classproperty: http://stackoverflow.com/a/5191224/633961
I have not tried setting the value yet, but getting the value works very fine.
It would be great to have "@classproperty" even in Python2. Or at least installable via pip.
I am just a user in this case. I don't know about the best, cleanest, most efficient way to implement this.
Reminds me of cached_property: https://pypi.python.org/pypi/cached-property/0.1.5
I feel it could be useful to have a holistic solution (property + cached + instance,classes,modules) in the stdlib/Python somehow.
Best, Sven
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/