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
I was surprised to be getting the following error with Mypy:
error: Incompatible types in assignment (expression has type"str", base class "Derived1" defined the type as "int”)
Within the scope of Derived1 it makes sense to me that mypy may restrict the type to just int, but in the subsequent child class of Dervied2 I was surprised that the implicit annotation in Dervied1 took precedence over the explicit annotation provided in the Base class
I was getting this error with Python 3.7.2 on mypy master
The text was updated successfully, but these errors were encountered:
WillAyd
changed the title
Annotation Getting Overridden Through Multilevel Inheritance
Annotation Overridden Through Multilevel Inheritance
May 2, 2019
Assuming a class structure as follows:
I was surprised to be getting the following error with Mypy:
Within the scope of Derived1 it makes sense to me that mypy may restrict the type to just int, but in the subsequent child class of Dervied2 I was surprised that the implicit annotation in Dervied1 took precedence over the explicit annotation provided in the Base class
I was getting this error with Python 3.7.2 on mypy master
The text was updated successfully, but these errors were encountered: