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
Bug Report
For some reason, mypy doesn't handle working with a dictionary, a lambda function, and the get function correctly.
mypy
lambda
get
To Reproduce
from typing import Callable def test_me(my_dict: dict | None = None) -> None: def _f(func: Callable) -> None: func('a') if my_dict is not None: _f(lambda x: my_dict.get(x))
Gist, Playgroud
Actual Behavior
error: Item "None" of "dict[Any, Any] | None" has no attribute "get" [union-attr]
Your Environment
The text was updated successfully, but these errors were encountered:
Thanks, duplicate of #16056
Sorry, something went wrong.
No branches or pull requests
Bug Report
For some reason,
mypy
doesn't handle working with a dictionary, alambda
function, and theget
function correctly.To Reproduce
Gist, Playgroud
Actual Behavior
error: Item "None" of "dict[Any, Any] | None" has no attribute "get" [union-attr]
Your Environment
The text was updated successfully, but these errors were encountered: