Nick Coghlan <ncogh...@gmail.com> added the comment:

After writing my previous comment, I double-checked the code, and 
cached_propery is actually one of the cases where a simple "self.attrname = 
'age3'" *will* do the right thing, as cached_property never checks the class 
information.

That won't work in the general case though, and I think it makes more sense for 
the cached_property documentation to provide advice that will generalise to 
arbitrary descriptors (i.e. call `descr.__set_name__(target, "attr")`)

----------

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

Reply via email to