В моем проекте мой Mypy преследует меня из-за какого-то наследования, и я не могу найти причину, по которой в некоторых случаях он не жалуется на ошибку:
note: In class "Cat":
Incompatible types in assignment (expression has type "Dict[str, Any]", base class "Animal" defined the type as "None")
и не для Собаки, пример кода:
class Animal:
attributes = None
def __init__(self):
if attributes is None:
raise NotImplementedExcepton
class Cat(Animal):
attributes = {
'fur': 'black',
'sound': 'meow',
}
class Dog(Animal):
attributes = {
'fur': 'brown',
'sound': 'woof',
}
Подробнее здесь: https://stackoverflow.com/questions/632 ... mypy-error