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
Currently mypy does not check that argument names in functions that implement protocols match the argument names in the protocol. This fails when arguments are passed as keywords.
This seems to be a deliberate decision: only __call__ arg names are checked, other are explicitly ignored. But that dates to 2018, perhaps it's fine to get stricter now?
This seems to be a deliberate decision: only __call__ arg names are checked, other are explicitly ignored. But that dates to 2018, perhaps it's fine to get stricter now?
Maybe we could implement it and see fallout in mypy primer.
Feature
Currently mypy does not check that argument names in functions that implement protocols match the argument names in the protocol. This fails when arguments are passed as keywords.
For example, this passes mypy:
but fails at runtime:
Pitch
If we checked this in mypy, we could prevent runtime errors like the one above.
The text was updated successfully, but these errors were encountered: