Closed damusss closed 1 month ago
Note that typing.py
and typing.pyi
should exclude TypeAlias
in either case, because it is not guaranteed that typing_extensions
will be available at runtime.
The linked PR puts up what I think is the best fix for now.
A recent PR marked types inside
typing.py
withTypeAlias
, but that object is only available from python 3.10. We now know how it passed the checks: inside__init__.py
we catch import errors, and importing TypeAlias from typing before 3.10 results in an import error, so pygame.typing becomes a missing module with no exception. Once a PR fixing this is merged, the unit test for typing can be merged and issues like this won't appear again.We can fix this in two ways:
TypeAlias
TypeAlias
on 3.10+ but use the old system otherwiseThe one choosing should be @zoldalma999 as they made the original PR. :3