-
Notifications
You must be signed in to change notification settings - Fork 216
Open
Labels
typing semanticstyping-module features, spec compliance, etctyping-module features, spec compliance, etc
Milestone
Description
Mypy, pyright and pyrefly all detect the unsoundness here. We should too:
from abc import abstractmethod
class F:
@abstractmethod
def method(self) -> int: ...
class G(F):
def method(self) -> int:
# mypy: error: Call to abstract method "method" of "F" with trivial body via super() is unsafe [safe-super]
return super().method()This is similar to, but distinct from, #1877.
We should ensure that abstract properties are also covered, e.g.
from abc import abstractmethod
class F:
@property
@abstractmethod
def prop(self) -> int: ...
class G(F):
@property
def prop(self) -> int:
# mypy: error: Call to abstract method "method" of "F" with trivial body via super() is unsafe [safe-super]
return super().propReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
typing semanticstyping-module features, spec compliance, etctyping-module features, spec compliance, etc