Closed as not planned
Description
Class properties were introduced in Python 3.9, and used to be unanalysed in 0.971:
# mypy 0.971
class A:
@property
@classmethod
def bad_class_property(cls) -> int: # No mypy error
return 8
@classmethod
@property
def good_class_property(cls) -> int: # No mypy error
return 8
>>> A.bad_class_property
<property at 0x...>
>>> A.good_class_property
8
Now, we have
# mypy 0.981
class A:
@classmethod # Only instance methods can be decorated with @property [misc]
@property
def good_class_property(cls) -> int:
return 8
Metadata
Metadata
Assignees
Labels
No labels