Covariant overriding of attributes is allowed though it's clearly unsafe. Example:
classA:
x: floatclassB(A):
x: int# no error, though unsafedeff(a: A) ->None:
a.x=1.1b=B()
f(b)
b.x# float at runtime, though declared as int
Mypy should reject x: int in B. If this is actually what the programmer intended, they can use # type: ignore.
Covariant overriding of attributes is allowed though it's clearly unsafe. Example:
Mypy should reject
x: intinB. If this is actually what the programmer intended, they can use# type: ignore.