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 don't think mypy should report an error. The Kwargs class is final, so it should not be subclassed, and it is total, so it should have all of its keywords.
The * makes it seem like mypy thinks my subclass method allows for additional parameters that are not present in the parent method, but I don't see where it is getting that idea.
Your Environment
Mypy version used: 1.13.0
Mypy command-line flags: None (I reproduced it on the playground)
Mypy configuration options from mypy.ini (and other config files): None
Python version used: 3.12
The text was updated successfully, but these errors were encountered:
Mypy is correct to generate an error here. The Parent.harf method has a parameter a that accepts both positional and keyword arguments, but you're attempting to override it with a method that accepts a only as a keyword argument.
You can fix the type error by changing Parent.harf to accept a only as a keyword argument, like this:
Bug Report
When using Unpack and TypedDict in a child class method, mypy is giving a false override error.
To Reproduce
https://mypy-play.net/?mypy=latest&python=3.12&gist=78008ce1aa8f6b34a332ea34e2937efc
Expected Behavior
I don't think mypy should report an error. The Kwargs class is final, so it should not be subclassed, and it is total, so it should have all of its keywords.
Actual Behavior
The
*
makes it seem like mypy thinks my subclass method allows for additional parameters that are not present in the parent method, but I don't see where it is getting that idea.Your Environment
mypy.ini
(and other config files): NoneThe text was updated successfully, but these errors were encountered: