We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Mapping
MutableMapping
Mapping and MutableMapping information for get and pop says that the default parameter is positional or keyword.
get
pop
default
dict says positional only, and that is correct at runtime.
dict
So this type checks with no errors, but crashes with TypeError:
TypeError
from collections.abc import Mapping, MutableMapping def foo(x: MutableMapping[str, int]) -> int: return x.pop("3", default=3) foo({}) # crash: TypeError: dict.pop() takes no keyword arguments def goo(x: Mapping[str, int]) -> int: return x.get("3", default=3) goo({}) # crash: TypeError: dict.get() takes no keyword arguments # same with MutableMapping.get
The text was updated successfully, but these errors were encountered:
No branches or pull requests
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: