8000 GH-89812: Add `pathlib._PurePathExt` by barneygale · Pull Request #104810 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

GH-89812: Add pathlib._PurePathExt #104810

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

Closed
wants to merge 20 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' into gh-89812-add-lexicalpath
  • Loading branch information
barneygale committed May 29, 2023
commit 1e24f80773012e24ff67040e56a25ae34a1171ce
9 changes: 5 additions & 4 deletions Lib/pathlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,10 +673,6 @@ def match(self, path_pattern, *, case_sensitive=None):
return False
return True

# Subclassing os.PathLike makes isinstance() checks slower,
# which in turn makes Path construction slower. Register instead!
os.PathLike.register(PurePath)


class PurePath(_BasePurePath, os.PathLike):
"""Base class for manipulating paths without I/O.
Expand Down Expand Up @@ -728,6 +724,11 @@ def as_uri(self):
return prefix + urlquote_from_bytes(os.fsencode(path))


# Subclassing os.PathLike makes isinstance() checks slower,
# which in turn makes Path construction slower. Register instead!
os.PathLike.register(PurePath)


class PurePosixPath(PurePath):
"""PurePath subclass for non-Windows systems.

Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.
0