We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
python
Learn more about funding links in repositories.
Report abuse
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
from typing import List class Foo: def keys(self) -> List[str]: return ['a', 'b', 'c'] def __getitem__(self, key: str) -> str: return f'value of {key}' print(dict(Foo())) # {'a': 'value of a', 'b': 'value of b', 'c': 'value of c'}
works at runtime but fails type check
tkinter widgets are like this, they aren't Mapping but they have .keys() and __getitem__
Mapping
.keys()
__getitem__
The text was updated successfully, but these errors were encountered:
Sounds reasonable. See also #3576 and #4325.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
works at runtime but fails type check
tkinter widgets are like this, they aren't
Mapping
but they have.keys()
and__getitem__
The text was updated successfully, but these errors were encountered: