Skip to content

stubtest false positive with runtime type alias for Callable #12821

Closed
@JelleZijlstra

Description

@JelleZijlstra

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions