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
This is not a bug. This actually violates Liskov. The suppertype can accept arbitrary keywords, while subtype only some.
Doesn't that depend on the definition of completeness? I.e. the TypedDict defines the keyword arguments which must be present, but just technically you can still pass any other arguments to it, as well. The code wouldn't break.
I also checked pyright, which does not emit an error, at the moment.
If you really want to express "I don't care about arguments", use *args: Any, **kwargs: Any. Mypy special-cases this as "whatever works".
Adding *args isn't an option in this case, unfortunately.
Bug Report
Came across this override error while testing
**kwargs
unpack from #13471./CC: @ilevkivskyi
To Reproduce
Expected Behavior
The parent methods uses
Any
as annotation for**kwargs
. Any override withUpack[_TypedDict_]
should be compatible.Actual Behavior
Your Environment
0.980+dev.0c0f071ef5d41c24182a5a94a5db882f9e917802 (compiled: no)
--enable-incomplete-features
3.10
The text was updated successfully, but these errors were encountered: