Closed
Description
When running mypy over the stand-alone asyncio package (https://github.com/python/asyncio) using mypy asyncio
I get some unexpected errors about uses of AnyStr in the stub for struct.pyi. I can't repro this easily in a smaller context, and in fact it doesn't repro of I point mypy at just asyncio/windows_events.py either. @JukkaL, do you have any idea what might be going on here?
$ mypy asyncio
asyncio/__init__.py:11: error: No library stub file for standard library module 'selectors'
asyncio/__init__.py:11: note: (Stub files are from https://github.com/python/typeshed)
asyncio/__init__.py:18: error: Cannot find module named '_overlapped'
asyncio/__init__.py:18: note: (Perhaps setting MYPYPATH would help)
asyncio/windows_utils.py:10: error: Cannot find module named '_winapi'
asyncio/windows_utils.py:37: error: Name 'socketpair' already defined
asyncio/windows_events.py:3: error: Cannot find module named '_winapi'
asyncio/windows_events.py:7: note: In module imported here:
/Users/guido/v3/lib/mypy/typeshed/stdlib/3/struct.pyi: note: In function "pack":
/Users/guido/v3/lib/mypy/typeshed/stdlib/3/struct.pyi:9: error: Invalid type "typing.AnyStr"
/Users/guido/v3/lib/mypy/typeshed/stdlib/3/struct.pyi: note: In function "pack_into":
/Users/guido/v3/lib/mypy/typeshed/stdlib/3/struct.pyi:11: error: Invalid type "typing.AnyStr"
/Users/guido/v3/lib/mypy/typeshed/stdlib/3/struct.pyi: note: In function "unpack":
/Users/guido/v3/lib/mypy/typeshed/stdlib/3/struct.pyi:14: error: Invalid type "typing.AnyStr"
/Users/guido/v3/lib/mypy/typeshed/stdlib/3/struct.pyi: note: In function "unpack_from":
/Users/guido/v3/lib/mypy/typeshed/stdlib/3/struct.pyi:15: error: Invalid type "typing.AnyStr"
/Users/guido/v3/lib/mypy/typeshed/stdlib/3/struct.pyi: note: In function "calcsize":
/Users/guido/v3/lib/mypy/typeshed/stdlib/3/struct.pyi:17: error: Invalid type "typing.AnyStr"
/Users/guido/v3/lib/mypy/typeshed/stdlib/3/struct.pyi: note: In function "__init__":
/Users/guido/v3/lib/mypy/typeshed/stdlib/3/struct.pyi:23: error: Invalid type "typing.AnyStr"
[the rest is not relevant to this issue]