-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply Gemini's ideas for improving the types.
Closes #2
- Loading branch information
Showing
1 changed file
with
31 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
StrPath = Union[str, os.PathLike[str]]
would be more accurate, but that would lead to an error in Python 3.8However this alias already exists and is used everywhere in typeshed.
If you want a runtime alias that is complete and works on all supported Python version, here's how I did it in setuptools: https://github.com/pypa/setuptools/blob/5e1b3c414779317bc3e105d9bae82ce70c22dbf9/setuptools/_path.py#L9-L12
(There's also a
str | os.PathLike
leftover below)