Closed
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]]