-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed as not planned
Closed as not planned
Copy link
Labels
featurepriority-1-normaltopic-descriptorsProperties, class vs. instance attributesProperties, class vs. instance attributestopic-inheritanceInheritance and incompatible overridesInheritance and incompatible overridestopic-runtime-semanticsmypy doesn't model runtime semantics correctlymypy doesn't model runtime semantics correctly
Description
If I declare a property getter on a base class, I can't declare a setter on a child class without having to add a getter there as well.
For example,
class A(object):
__metaclass__ = ABCMeta
@property
def prop(self):
# type: () -> int
return 1
class B(A):
@A.prop.setter
def prop(self, val):
# type: (int) -> None
pass
is a valid python code, but mypy fails with "Callable[[A], int]" has no attribute "setter"
Metadata
Metadata
Assignees
Labels
featurepriority-1-normaltopic-descriptorsProperties, class vs. instance attributesProperties, class vs. instance attributestopic-inheritanceInheritance and incompatible overridesInheritance and incompatible overridestopic-runtime-semanticsmypy doesn't model runtime semantics correctlymypy doesn't model runtime semantics correctly