-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename _typeshed.AnyPath? #5470
Comments
Tkinter stubs have a generic alias: typeshed/stdlib/tkinter/__init__.pyi Line 100 in 4a3b6eb
|
If only we could rename
I think mypy has issues with aliases of the form I'm not having much luck thinking of a better name that's still concise. |
Maybe |
* Replace all uses of StrPath, BytesPath, and AnyPath in Python 2 stubs. * Add StrOrBytesPath as preferred alias for AnyPath. * Replace all remaining AnyPath instances with StrOrBytesPath. * Mark AnyPath as obsolete. Part of python#5470
* Replace all uses of StrPath, BytesPath, and AnyPath in Python 2 stubs. * Add StrOrBytesPath as preferred alias for AnyPath. * Replace all remaining AnyPath instances with StrOrBytesPath. * Mark AnyPath as obsolete. Part of #5470
Part of python#5470
#5592 removes |
The original |
TLDR: Let's rename
AnyPath
toPathName
(or a better alias).I seem to remember that @JelleZijlstra didn't like the name
AnyPath
as an alias forstr | bytes | PathLike[str] | PathLike[bytes]
when I introduced it. I agreed, but couldn't come up with a better name. When working on #5467, it became apparent to me that having a "real"AnyPath
, i.e. an alias that is basicallyAnyPath[_T] = _T | PathLike[_T]
would be quite useful. I don't think there is a way to have a generic alias yet, but I still propose we should renameAnyPath
in preparation and to avoid confusion withAnyStr
. The best I can come up with at the moment isPathName
. Any better ideas? Other suggestions? Not a good idea?The text was updated successfully, but these errors were encountered: