-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
bugmypy got something wrongmypy got something wrongtopic-descriptorsProperties, class vs. instance attributesProperties, class vs. instance attributestopic-stubgen
Description
After #8913 mypy can understand that @cached_property
is a property
.
So, I think that stubgen
must reflect that. Right now if you run stubgen
on this code:
from functools import cached_property
class A:
@cached_property
def x(self):
return 'x'
You will get:
class A:
def x(self): ...
This is incorrect, because it turns a property into a method.
But, ideally you should get:
from functools import cached_property
class A:
@cached_property
def x(self): ...
I already have a working prototype of the solution. Please, feel free to comment on the PR :)
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongtopic-descriptorsProperties, class vs. instance attributesProperties, class vs. instance attributestopic-stubgen