-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
bugmypy got something wrongmypy got something wrongtopic-stubtesttopic-type-aliasTypeAlias and other type alias issuesTypeAlias and other type alias issues
Description
Bug Report
Using mypy 0.960 and Python 3.9.2, stubtest reports a mismatch between runtime and a stub file when both use an identical TypeAlias
annotation:
error: wsgiref.types.WSGIEnvironment is not a type
Stub: at line 1003
<TypeInfo builtins.dict>
Runtime:
dict[str, typing.Any]
(Source: https://github.com/python/typeshed/runs/7319247103?check_suite_focus=true)
In this case, the offending line is WSGIEnvironment: TypeAlias = dict[str, Any]
, both at runtime and the stub. Interestingly, the following line works ok:
WSGIApplication: TypeAlias = Callable[[WSGIEnvironment, StartResponse], Iterable[bytes]]
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongtopic-stubtesttopic-type-aliasTypeAlias and other type alias issuesTypeAlias and other type alias issues