Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
merged 11 commits into from
May 11, 2025
Merged

Update pathlib for 3.14 #14006

merged 11 commits into from
May 11, 2025

Conversation

max-muoto
Copy link
Contributor

@max-muoto max-muoto commented May 11, 2025

Make pathlib updates for 3.14.

  • Remove methods that didn't make it's way into the beta.
  • Add new pathlib.Path methods, accounting for the fact that if target_type is a non PurePath then Self is returned otherwise the type of target_type is returned.
  • Add new pathlib.types module and PathInfo protocol.

This comment has been minimized.

on_error: Callable[[OSError], object] | None = None,
) -> None: ...
@property
def info(self) -> _PathInfo: ...
Copy link
Contributor Author

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.

@max-muoto max-muoto marked this pull request as ready for review May 11, 2025 06:27

This comment has been minimized.

Copy link
Collaborator

@srittau srittau left a 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.

@max-muoto
Copy link
Contributor Author

Thanks, two remarks below.

Thanks, comments addressed!

This comment has been minimized.

Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@srittau srittau merged commit 268a2e7 into python:main May 11, 2025
64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants