-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Update pathlib for 3.14 #14006
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
Update pathlib for 3.14 #14006
Conversation
This comment has been minimized.
This comment has been minimized.
stdlib/pathlib/__init__.pyi
Outdated
on_error: Callable[[OSError], object] | None = None, | ||
) -> None: ... | ||
@property | ||
def info(self) -> _PathInfo: ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The technical accurate type would be pathlib._os._WindowsPathInfo | pathlib._os._PosixPathInfo | pathlib._os.DirEntryInfo
but considering they all implement the exact same methods (and live in a private module) defining a type-checking only type made more sense to me. Open to changing this however.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, two remarks below.
Thanks, comments addressed! |
This comment has been minimized.
This comment has been minimized.
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
Make
pathlib
updates for 3.14.pathlib.Path
methods, accounting for the fact that iftarget_type
is a non PurePath thenSelf
is returned otherwise the type oftarget_type
is returned.pathlib.types
module andPathInfo
protocol.