Closed
Description
I have two classes defined like so:
# test.py
from typing import Any
class MyBase:
def __init__(self, *args: Any, **kwargs: Any) -> None:
self.override_me(*args, **kwargs)
def override_me(self, *args: Any, **kwargs: Any) -> None:
pass
class MyHeir(MyBase):
def override_me(self, message: str) -> None:
print(message)
And the corresponding mypy output:
test.py:13: error: Signature of "override_me" incompatible with supertype "MyBase"
Now, I'm a bit new to this typing thing and don't have a background in type theory, but in my mind, these signatures are compatible, even though I can see why mypy would disagree.
Is there a better way to notate the types here? Is there a way to override this in mypy except for preventing all type checking on the "wrong" lines?
Metadata
Metadata
Assignees
Labels
No labels