This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author hongweipeng
Recipients hongweipeng
Date 2019-10-19.07:30:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1571470251.68.0.879446650629.issue38524@roundup.psfhosted.org>
In-reply-to
Content
```
from functools import cached_property
def age(self):
    return 10
class A:
    def __init__(self):
        setattr(self.__class__, 'age', property(age))
        setattr(self.__class__, 'age3', cached_property(age))

    age2 = cached_property(age)

a = A()
print(a.age)    # 10
print(a.age2)   # 10
print(a.age3)   # TypeError: Cannot use cached_property instance without calling __set_name__
```
Is it expected?
History
Date User Action Args
2019-10-19 07:30:51hongweipengsetrecipients: + hongweipeng
2019-10-19 07:30:51hongweipengsetmessageid: <1571470251.68.0.879446650629.issue38524@roundup.psfhosted.org>
2019-10-19 07:30:51hongweipenglinkissue38524 messages
2019-10-19 07:30:51hongweipengcreate