gh-68320, gh-88302 - Allow for `pathlib.Path` subclassing by barneygale · Pull Request #31691 · python/cpython · GitHub

github.com

Tin mới

barneygale:bpo-44136-remove-pathlib-flavour-2

GitHub CopilotWrite better code with AI

GitHub Copilot appDirect agents from issue to merge

ActionsAutomate any workflow

CodespacesInstant dev environments

IssuesPlan and track work

Code ReviewManage code changes

Code QualityEnforce quality at merge

GitHub Advanced SecurityFind and fix vulnerabilities

Code securitySecure your code as you build

Secret protectionStop leaks before they start

View all use cases

Financial services

View all industries

Software Development

GitHub SponsorsFund open source developers

Copilot for BusinessEnterprise-grade AI features

Premium SupportEnterprise-grade 24/7 support

Pull requests 2.6k

Security and quality 0

Direct sub-classing of pathlib.Path #68320

bpo-24132, bpo-44136 - Fix pathlib.Path subclassing.

bpo-24132: Add pathlib._AbstractPath #31085

Add tests for PurePath subclasses

View reviewed changes

Update Misc/NEWS.d/next/Library/2022-03-05-02-14-09.bpo-24132.W6iORO.rst

Rename PurePath._pathmod to PurePath._flavour to reduce the diff.

Merge branch 'bpo-44136-remove-pathlib-flavour-2' of github.com:barne…

Undo an unnecessary change to Path.__new__()

Remove _casefold() and _casefold_parts() methods.

OSError when try convert URI to pathlib.Path #91504

Merge branch 'main' into bpo-44136-remove-pathlib-flavour-2

Further simplify overall diff by inlining code from compile_pattern()

View reviewed changes

Learn more about hiding disruptive comments

The reason will be displayed to describe this comment to others. Learn more.

Apply suggestions from code review

Address a couple bits of review feedback

awaiting change review

Merged main into regmachine branch (

Fake pathlib not working with Python 3.12-dev pytest-dev/pyfakefs#770

Improve Windows performance of pathlib.Path.is_file and friends #101357

Vestigial pathlib 'flavour' tests make assertions about internal method #103379

Static tools doesn't see class members (at least for trio.Path) python-trio/trio#2630

GH-81079: Add case_sensitive argument to pathlib.Path.glob() #102710

Optimize pathlib.Path.glob() by avoiding repeated calls to os.path.normcase() #104104

GH-104104: Optimize `pathlib.Path.glob()` by avoiding repeated calls to `os.path.normcase()` Use `re.IGNORECASE` to implement case-insensitive matching. This restores behaviour from before #31691.

GH-104104: Optimize pathlib.Path.glob() by avoiding repeated calls to os.path.normcase() #104105

GH-104104: Optimize `pathlib.Path.glob()` by avoiding repeated calls to `os.path.normcase()` (GH-104105) Use `re.IGNORECASE` to implement case-insensitive matching. This restores behaviour from before GH-31691.

pathlib: Where does "self._flavour" comes from? (3.11 to 3.12 migration) #104921

pathlib.PureWindowsPath comparison results vary between Windows and Posix #104947