Proposal: Remove pygame.typing.PathLike
type from the API
#3085
Labels
type hints
Type hint checking related tasks
pygame.typing.PathLike
type from the API
#3085
From the discussion in #3080, I think it may be a good idea to remove
typing.PathLike
union type alias.Here are some arguments for removing it or making it internal:
PathLike
back in if it is useful than it is to removePathLike
if it is unnecessarytyping.FileLike
: insiderwobject.pyi
as the parameter type forencode_string()
andencode_file_path()
. Though there could be more undiscovered usesFileLike
)_typeshed
types:StrOrBytesPath
os.PathLike
, which is used in the definition ofpygame.typing.PathLike
(confusing?)Also proposing a separate but related internal change: Still use
os.PathLike
for python <=3.8 (where it is not generic), by defining the other type in the version conditional, as so:This is so we don't have to define a custom internal protocol class with the same behavior as
os.PathLike
.The text was updated successfully, but these errors were encountered: