René's URL Explorer Experiment


Title: bpo-24132: Direct sub-classing of pathlib.Path by kfollstad · Pull Request #26438 · python/cpython · GitHub

Open Graph Title: bpo-24132: Direct sub-classing of pathlib.Path by kfollstad · Pull Request #26438 · python/cpython

X Title: bpo-24132: Direct sub-classing of pathlib.Path by kfollstad · Pull Request #26438 · python/cpython

Description: Updated based on feedback - currently marked as draft I submit for your consideration what I believe is the first working version (with documentation) of an extensible, subclassable PurePath/Path to close bpo-24132, a 6-year-old bug. I have also posted a more detailed version of this explanation on discuss.python.org because this fix involves adding classes to pathlib and understanding why that is required takes a significant explanation. These classes are a complete set of alternatives to PurePath and Path which omit the factory design but instead attach the flavour to the class at the time of instantiation. These newly designed classes still pass all of the test cases that are run against PurePath and Path on both Windows and Linux. Because they omit the factory design, they don't have inverted dependencies and therefore are naively subclassable and extensible in any way you see fit. To this end I give you: SimplePath (subclassable alternative to PurePath) SimplePosixPath (subclassable alternative to PurePosixPath) SimpleWindowsPath (subclassable alternative to PureWindowsPath) FilePath (subclassable alternative to Path/PosixPath/WindowsPath) On Windows, SimplePath behaves as if it were PureWindowsPath. On Posix, it behaves as PurePosixPath. Similarly, FilePath behaves like WindowsPath on Windows and PosixPath on Posix. These four classes combined could, if one were so inclined, act as a complete replacement for the existing six Path/PurePath classes. Despite being 11 commits, it's essentially just two refactors. The first splits the two responsibilities PurePath has, separating the base class methods into _PurePathBase. The second does the same with Path, moving the base class methods into PathIOMixin. The other commits are just minor tweaks and documentation to account for all of that. https://bugs.python.org/issue24132

Open Graph Description: Updated based on feedback - currently marked as draft I submit for your consideration what I believe is the first working version (with documentation) of an extensible, subclassable PurePath/Path t...

X Description: Updated based on feedback - currently marked as draft I submit for your consideration what I believe is the first working version (with documentation) of an extensible, subclassable PurePath/Path t...

Opengraph URL: https://github.com/python/cpython/pull/26438

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:56d20cdc-46c7-8e7b-63ac-3cc5fd77b2c5
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8398:6AD60:1473471:1CA484C:69691C98
html-safe-nonce747df839a8397f0ff6afae76c4dce460f92b4c210cdd954869136f19d93a40e6
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Mzk4OjZBRDYwOjE0NzM0NzE6MUNBNDg0Qzo2OTY5MUM5OCIsInZpc2l0b3JfaWQiOiIzNDE2NjMyOTA1MDQ5OTA2MzI4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac08512727d7285eb36dd5bdeab572fccb40088b7b5057095135ea5021b4a971b0
hovercard-subject-tagpull_request:657130754
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/26438/files
twitter:imagehttps://avatars.githubusercontent.com/u/24860864?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/24860864?s=400&v=4
og:image:altUpdated based on feedback - currently marked as draft I submit for your consideration what I believe is the first working version (with documentation) of an extensible, subclassable PurePath/Path t...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None0e60568924309a021b51adabdce15c2a2f285b556f3130d1a2fa2a5bce11c55f
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasedd206f7ed6207863172be4a783826e86bd2375c3
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/26438/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F26438%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F26438%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/26438/files
Reloadhttps://github.com/python/cpython/pull/26438/files
Reloadhttps://github.com/python/cpython/pull/26438/files
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/26438/files
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 33.9k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 71.1k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects 31 https://github.com/python/cpython/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python/cpython/security
Please reload this pagehttps://github.com/python/cpython/pull/26438/files
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
kfollstadhttps://github.com/kfollstad
python:mainhttps://github.com/python/cpython/tree/main
kfollstad:PathlibSimplePathhttps://github.com/kfollstad/cpython/tree/PathlibSimplePath
Conversation 3 https://github.com/python/cpython/pull/26438
Commits 11 https://github.com/python/cpython/pull/26438/commits
Checks 0 https://github.com/python/cpython/pull/26438/checks
Files changed https://github.com/python/cpython/pull/26438/files
Please reload this pagehttps://github.com/python/cpython/pull/26438/files
bpo-24132: Direct sub-classing of pathlib.Path https://github.com/python/cpython/pull/26438/files#top
Show all changes 11 commits https://github.com/python/cpython/pull/26438/files
f011491 bpo-24132: Add stub SimplePath/FilePath classes to pathlib kfollstad Apr 30, 2021 https://github.com/python/cpython/pull/26438/commits/f011491b0ad98e157261f52d5173119763328770
ff1d455 bpo-24132: Replace hardcoded references where possible in pathlib kfollstad Apr 30, 2021 https://github.com/python/cpython/pull/26438/commits/ff1d4553c9d7613bcab4693ef3483b5ded18c17d
488994f bpo-24132: Refactor PurePath methods into base class in pathlib kfollstad May 3, 2021 https://github.com/python/cpython/pull/26438/commits/488994f89eac8e00f84a6a05340f160175d38182
6a69e0d bpo-24132: Completed SimplePath in pathlib kfollstad May 3, 2021 https://github.com/python/cpython/pull/26438/commits/6a69e0dd813d9fccf913971e62919f049a1b6cf6
09317e2 bpo-24132: Partial implmentation of FilePath in pathlib kfollstad May 3, 2021 https://github.com/python/cpython/pull/26438/commits/09317e2e71e664938e5eef09cca08128bdab144c
d966acf bpo-24132: Fix inconsistent organization of is_mount in pathlib kfollstad May 27, 2021 https://github.com/python/cpython/pull/26438/commits/d966acfb99f93db5f060b38ae698ae39bde9e6be
ed5f237 bpo-24132: Replace additional hardcoded references in pathlib kfollstad May 3, 2021 https://github.com/python/cpython/pull/26438/commits/ed5f237ca46d150cc2343e64814453be8f54267d
ecc341b bpo-24132: Completed FilePath in pathlib kfollstad May 5, 2021 https://github.com/python/cpython/pull/26438/commits/ecc341ba9261bd6ed1e3daf1eb05e7591f909d85
2700e46 bpo-24123: Add SimplePosixPath and SimpleWindowsPath to pathlib kfollstad May 25, 2021 https://github.com/python/cpython/pull/26438/commits/2700e46b2a07fd928cbbc6f126eb416cbc053cff
d15d8da bpo-24132: Fix validity of inter-path comparison in pathlib kfollstad May 26, 2021 https://github.com/python/cpython/pull/26438/commits/d15d8da8ebb3d23934f2ca476d063cee0480f863
6028b6d bpo-24132: Document FilePath and SimplePath family in pathlib kfollstad May 26, 2021 https://github.com/python/cpython/pull/26438/commits/6028b6de32ec2466cb046623ae26ef7b999477e6
Clear filters https://github.com/python/cpython/pull/26438/files
Please reload this pagehttps://github.com/python/cpython/pull/26438/files
Please reload this pagehttps://github.com/python/cpython/pull/26438/files
pathlib.rst https://github.com/python/cpython/pull/26438/files#diff-1134e36a94ecfde1df43bee5efd285de5d67426fbca086425201ecc753f9139c
pathlib.py https://github.com/python/cpython/pull/26438/files#diff-fa525485738fc33d05b06c159172ff1f319c26e88d8c6bb39f7dbaae4dc4105c
test_pathlib.py https://github.com/python/cpython/pull/26438/files#diff-3dd97d2dc8816848d0b0c442e8fdeec9650b3de77935289a93f37ac6396ee17f
ACKS https://github.com/python/cpython/pull/26438/files#diff-d1243956feb505c5459fc05387e194609efb5c350cee202942be47ed30d7d7d0
2021-05-25-21-25-39.bpo-24132.37mJNj.rst https://github.com/python/cpython/pull/26438/files#diff-34a51d022f85e41c19ba2da49591faba94f5ca89bcf1b13bb4937540a734dfd8
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L525
Doc/library/pathlib.rsthttps://github.com/python/cpython/pull/26438/files#diff-1134e36a94ecfde1df43bee5efd285de5d67426fbca086425201ecc753f9139c
View file https://github.com/kfollstad/cpython/blob/6028b6de32ec2466cb046623ae26ef7b999477e6/Doc/library/pathlib.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/26438/{{ revealButtonHref }}
https://github.com/python/cpython/pull/26438/files#diff-1134e36a94ecfde1df43bee5efd285de5d67426fbca086425201ecc753f9139c
https://github.com/python/cpython/pull/26438/files#diff-1134e36a94ecfde1df43bee5efd285de5d67426fbca086425201ecc753f9139c
https://github.com/python/cpython/pull/26438/files#diff-1134e36a94ecfde1df43bee5efd285de5d67426fbca086425201ecc753f9139c
https://github.com/python/cpython/pull/26438/files#diff-1134e36a94ecfde1df43bee5efd285de5d67426fbca086425201ecc753f9139c
https://github.com/python/cpython/pull/26438/files#diff-1134e36a94ecfde1df43bee5efd285de5d67426fbca086425201ecc753f9139c
https://github.com/python/cpython/pull/26438/files#diff-1134e36a94ecfde1df43bee5efd285de5d67426fbca086425201ecc753f9139c
Please reload this pagehttps://github.com/python/cpython/pull/26438/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.