-
-
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
Function accepts callable, but a typeshed custom Protocol was passed #13480
Comments
Indeed, mypy (and all other type checkers) bundle typeshed, since it’s where they get type definitions for everything in the standard library. I can see the problem though: In 3.12, the stub specifies |
You'll get this error only on Python 3.12+ because the typeshed definition didn't allow This is not a mypy issue and mypy is correctly interpreting the type here. Pyright has the same behaviour. The definition at Lines 79 to 110 in 1d10860
Do note however, that |
Bug Report
(A clear and concise description of what the bug is.)
To Reproduce
I have some code like:
But I'm getting mypy errors like
Expected Behavior
I would assume this is fine this callable is fine and this is passing.
Actual Behavior
Your Environment
mypy.ini
(and other config files):ignore_missing_imports = true
I do NOT have Typeshed installed in my pip list, but I saw in typeshed that it may be bundled with mypy? Again I don't see it installed, but curious to know why this wouldn't work.
The text was updated successfully, but these errors were encountered: