Message354929
```
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? |
|
Date |
User |
Action |
Args |
2019-10-19 07:30:51 | hongweipeng | set | recipients:
+ hongweipeng |
2019-10-19 07:30:51 | hongweipeng | set | messageid: <1571470251.68.0.879446650629.issue38524@roundup.psfhosted.org> |
2019-10-19 07:30:51 | hongweipeng | link | issue38524 messages |
2019-10-19 07:30:51 | hongweipeng | create | |
|