-
Notifications
You must be signed in to change notification settings - Fork 135
Open
0 / 70 of 7 issues completedLabels
typing semanticstyping-module features, spec compliance, etctyping-module features, spec compliance, etc
Milestone
Description
This means checking that subclass methods are subtypes of the superclass method they override, if any.
Subclass property getters must return a subtype of the corresponding superclass property getters, and subclass property setters must accept a supertype of the corresponding superclass property setter.
If we model any mutable attribute as conceptually a property with getter and setter, where the setter accepts the same type that the getter returns, this implies that the type of mutable attributes must be invariant; that is, subclasses may neither widen nor narrow the type of the attribute. Pyright models this correctly; mypy does not.
See #167 for a demonstration of a particular case involving ClassVar.
akdoan1, neutrinoceros, edgarrmondragon and vlashada
Sub-issues
Metadata
Metadata
Assignees
Labels
typing semanticstyping-module features, spec compliance, etctyping-module features, spec compliance, etc