-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wrong positional-or-keyword information in Mapping
and MutableMapping
#13432
Comments
Yes, that's because Lines 1125 to 1131 in c193cd2
There's two ways to fix this, but both of them would need to happen in CPython, not in typeshed:
While 1. would be less disruptive, it will potentially add some small overhead to every Prototyping the second change in typeshed would allow us to see if any of the projects we check with mypy_primer rely on the current definition of If we can very quickly find one such instance in the standard library, there's a high likelihood there's thousands more in both the standard library and other people's code. |
It probably makes sense for us to claim in typeshed that Mapping/MutableMapping use positional-only arguments, since that's what dict does and in practice it's by far the most common mapping type. I think we do something similar in a few other places already. |
Mapping
andMutableMapping
information forget
andpop
says that thedefault
parameter is positional or keyword.dict
says positional only, and that is correct at runtime.So this type checks with no errors, but crashes with
TypeError
:The text was updated successfully, but these errors were encountered: