Skip to content

stubtest false positive with runtime type alias for Callable #12821

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

Closed
JelleZijlstra opened this issue May 20, 2022 · 0 comments · Fixed by #13116
Closed

stubtest false positive with runtime type alias for Callable #12821

JelleZijlstra opened this issue May 20, 2022 · 0 comments · Fixed by #13116
Labels
bug mypy got something wrong topic-stubtest topic-type-alias TypeAlias and other type alias issues

Comments

@JelleZijlstra
Copy link
Member

From python -m mypy.stubtest --custom-typeshed-dir . wsgiref:

error: wsgiref.types.WSGIApplication is not a recognised type alias
Stub: at line 14
def (builtins.dict[builtins.str, Any], wsgiref.types.StartResponse) -> typing.Iterable[builtins.bytes]
Runtime: in file /Users/jelle/py/cpython/Lib/collections/abc.py
collections.abc.Callable[[dict[str, typing.Any], wsgiref.types.StartResponse], collections.abc.Iterable[bytes]]

Once again, the stub and implementation are exactly the same. It's odd that the stub infers a def (...) while the runtime infers a collections.abc.Callable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong topic-stubtest topic-type-alias TypeAlias and other type alias issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants