Title: bpo-44136: remove `pathlib._Flavour` by barneygale · Pull Request #26141 · python/cpython · GitHub
Open Graph Title: bpo-44136: remove `pathlib._Flavour` by barneygale · Pull Request #26141 · python/cpython
X Title: bpo-44136: remove `pathlib._Flavour` by barneygale · Pull Request #26141 · python/cpython
Description: For bpo-24132, we'd like subclasses of AbstractPath to be able to customize flavour behaviour (like as_uri()) without needing to promote _Flavour to a public class. (Copy-pasted bug description:) Following #18841, #25264 and #25701, pathlib._Flavour and its subclasses are looking a bit pointless. The implementations of is_reserved() and make_uri() (~as_uri()) can be readily moved to into PurePosixPath and PureWindowsPath, which removes some indirection. This follows the pattern of OS-specific stuff in PosixPath and WindowsPath. The remaining methods, such as splitroot(), can be pulled into Pure*Path with an underscore prefix. I'm generally a believer in composition over inheritance, but in this case _Flavour seems too small and too similar to PurePath to separate out into 3 extra classes. There should be no impact on public APIs or performance. I've tried to split the changes up across commits; it may be easier to browse the diff that way. https://bugs.python.org/issue44136
Open Graph Description: For bpo-24132, we'd like subclasses of AbstractPath to be able to customize flavour behaviour (like as_uri()) without needing to promote _Flavour to a public class. (Copy-pasted bug description...
X Description: For bpo-24132, we'd like subclasses of AbstractPath to be able to customize flavour behaviour (like as_uri()) without needing to promote _Flavour to a public class. (Copy-pasted bug descrip...
Opengraph URL: https://github.com/python/cpython/pull/26141
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:6bbdf42c-7a60-4274-c8e3-0fa3879301e4 |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | CD7A:22C818:27FB0CD:37B74CA:69694D63 |
| html-safe-nonce | 180f669b1573b2789bd1437462d34012aac6275a075059add1344820d83c64fd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRDdBOjIyQzgxODoyN0ZCMENEOjM3Qjc0Q0E6Njk2OTRENjMiLCJ2aXNpdG9yX2lkIjoiNjU4OTMwMTY4NDQxNDUzMjk2MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3eb9b81768e54e6eea75e7e75e09ed3cf6e101ee42e1ca8b244d886b6469a6ae |
| hovercard-subject-tag | pull_request:645104524 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/python/cpython/pull/26141/checks |
| twitter:image | https://avatars.githubusercontent.com/u/960340?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/960340?s=400&v=4 |
| og:image:alt | For bpo-24132, we'd like subclasses of AbstractPath to be able to customize flavour behaviour (like as_uri()) without needing to promote _Flavour to a public class. (Copy-pasted bug description... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 54182691a21263b584d2e600b758e081b0ff1d10ffc0d2eefa51cf754b43b51d |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d69ac0477df0f87da03b8b06cebd187012d7a930 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width