Skip to content
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.