You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
8: error: "Callable[[C], int]" has no attribute "__get__"
I think the problem is that, in general, mypy assumes decorators don't change the signature of the decorated function. When I ask it to reveal the type of C.prop, it reports def (self: testcase.C) -> builtins.int, which is the signature of the undecorated function, not of the property.
Since the property decorator is a built-in, it would be useful to have dedicated support for it in mypy.
The text was updated successfully, but these errors were encountered:
When mypy 0.740 is run on the following code:
It reports:
I think the problem is that, in general, mypy assumes decorators don't change the signature of the decorated function. When I ask it to reveal the type of
C.prop
, it reportsdef (self: testcase.C) -> builtins.int
, which is the signature of the undecorated function, not of the property.Since the
property
decorator is a built-in, it would be useful to have dedicated support for it in mypy.The text was updated successfully, but these errors were encountered: