Mypy doesn't show errors when base method has *args: Any
or **kwargs: Any
#18980
Labels
bug
mypy got something wrong
Bug Report
If the base class / prototype has a method that accepts only
*args: Any
or / and**kwargs: Any
, mypy doesn't show any errors, even if the child class accepts only limited set of parameters. If I adda: int
tofoo
in the base class, nothing changes. If I addb: int
tofoo
in the base class, mypy show an error "Signature of "foo" incompatible with supertype "HasFoo"", that is expected.To Reproduce
Gist URL: https://gist.github.com/mypy-play/1a858925c056f8b5391e09a247b29ece
Playground URL: https://mypy-play.net/?mypy=latest&python=3.13&gist=1a858925c056f8b5391e09a247b29ece
Expected Behavior
Mypy should raise an error "Signature of "foo" incompatible with supertype "HasFoo"".
Actual Behavior
Mypy doesn't raise any errors. The code above fails in runtime.
Your Environment
mypy.ini
(and other config files):The text was updated successfully, but these errors were encountered: