Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-68320, gh-88302 - Allow forpathlib.Path subclassing#31691

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Merged
Changes from1 commit
Commits
Show all changes
53 commits
Select commitHold shift + click to select a range
7371220
bpo-24132, bpo-44136 - Fix `pathlib.Path` subclassing.
barneygaleMar 5, 2022
8431d12
Add tests
barneygaleMar 5, 2022
bf2ad3a
Add tests for PurePath subclasses
barneygaleMar 5, 2022
4036e2e
Update Misc/NEWS.d/next/Library/2022-03-05-02-14-09.bpo-24132.W6iORO.rst
barneygaleMar 5, 2022
0d08533
Rename `PurePath._pathmod` to `PurePath._flavour` to reduce the diff.
barneygaleMar 5, 2022
0ad8022
Merge branch 'bpo-44136-remove-pathlib-flavour-2' of github.com:barne…
barneygaleMar 5, 2022
28992fc
Undo an unnecessary change to `Path.__new__()`
barneygaleMar 25, 2022
dbec230
Remove `_casefold()` and `_casefold_parts()` methods.
barneygaleMar 25, 2022
d814ee4
Merge branch 'main' into bpo-44136-remove-pathlib-flavour-2
barneygaleApr 29, 2022
63f1d68
Further simplify overall diff by inlining code from `compile_pattern()`
barneygaleApr 29, 2022
8dddfdf
Apply suggestions from code review
barneygaleApr 29, 2022
b4da721
Address a couple bits of review feedback
barneygaleApr 29, 2022
7a166fd
Fix tests
barneygaleApr 29, 2022
1f4dff1
Fix docstring formatting.
barneygaleApr 29, 2022
51893c1
Remove FIXME comments
barneygaleApr 30, 2022
48b49b6
Merge branch 'main' into bpo-44136-remove-pathlib-flavour-2
barneygaleApr 30, 2022
3624c97
Update Lib/pathlib.py
barneygaleMay 3, 2022
ab54c14
Remove vestigal 'casefold' names.
barneygaleMay 31, 2022
2627417
Merge branch 'main' into bpo-44136-remove-pathlib-flavour-2
barneygaleJun 10, 2022
bc7aded
Restore comment on POSIX paths beginning `//` and tweak implementation.
barneygaleJun 10, 2022
4d6e4f3
Inline `_join_parsed_parts()` and `_make_child()` in `joinpath()`.
barneygaleJun 12, 2022
70ca838
Update Lib/pathlib.py
barneygaleJun 13, 2022
a2cc74f
Remove unused import
barneygaleJun 16, 2022
0e2478b
Make NEWS entry more precise.
barneygaleJun 17, 2022
0d0cf60
Apply suggestions from code review
barneygaleJul 29, 2022
f3048d3
Clarify `_pparts` and `_ncparts` naming.
barneygaleJul 29, 2022
8a213ae
Tidy up usage of `normcase()`
barneygaleJul 30, 2022
402dafe
Tweak `is_absolute()` to use `os.path.isabs()` wherever possible.
barneygaleJul 30, 2022
5cc3ab2
Stop using `self._flavour` in `as_uri()`.
barneygaleJul 30, 2022
19a8804
Remove `cls._flavour` identity check in `_parse_parts()`.
barneygaleJul 30, 2022
9da46bc
Fix Windows tests
barneygaleJul 30, 2022
29f9f81
Restore `_split_root()` method and its tests.
barneygaleAug 1, 2022
52851b8
Merge branch 'main' into bpo-44136-remove-pathlib-flavour-2
barneygaleAug 5, 2022
b39da53
Optimize `_split_root()`
barneygaleAug 12, 2022
c7b18b1
Merge branch 'main' into bpo-44136-remove-pathlib-flavour-2
barneygaleAug 13, 2022
806ad15
Move `is_reserved()` implementation into `os.path` as a private funct…
barneygaleAug 23, 2022
a350009
Use `os.path.normcase()` when globbing.
barneygaleAug 23, 2022
799b40e
Simplify `_split_root()` implementation.
barneygaleAug 25, 2022
a6b25ea
Remove tests for malformed UNC paths
barneygaleAug 26, 2022
ac6f6e2
Merge branch 'main' into bpo-44136-remove-pathlib-flavour-2
brettcannonAug 26, 2022
b8874df
Revert "Move `is_reserved()` implementation into `os.path` as a priva…
barneygaleAug 27, 2022
9d5e18a
Tweak _split_root() to use removesuffix()
barneygaleAug 27, 2022
f73f426
Remove test that `/b/c/d` and `///b/c/d` are equivalent.
barneygaleAug 27, 2022
37e4bc1
Restore comment linking to *Naming Files* page in Microsoft docs
barneygaleSep 16, 2022
e3f13ef
Apply suggestions from code review
barneygaleNov 7, 2022
ff4e1b3
Merge branch 'main' into bpo-44136-remove-pathlib-flavour-2
barneygaleNov 15, 2022
07c67d0
Clarify repr roundtrip tests.
barneygaleNov 15, 2022
950aa47
Reduce tests diff
barneygaleNov 15, 2022
d5f6f03
Remove test that `/b/c/d` and `///b/c/d` are equivalent.
barneygaleAug 27, 2022
b66a4fb
Fix missing full stops.
barneygaleNov 15, 2022
fbaadf4
Remove four more test assertions affected by #96290
barneygaleNov 15, 2022
3692fdf
Merge branch 'main' into bpo-44136-remove-pathlib-flavour-2
barneygaleNov 25, 2022
40dc514
Wrap repr test cases in `self.subTest()` block
barneygaleDec 17, 2022
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
PrevPrevious commit
NextNext commit
Merge branch 'main' intobpo-44136-remove-pathlib-flavour-2
  • Loading branch information
@barneygale
barneygale committedApr 29, 2022
commitd814ee4b4cd01ca15a6e74f5e9262a9abda18cfc
4 changes: 4 additions & 0 deletionsLib/pathlib.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -883,6 +883,8 @@ def glob(self, pattern):
drv, root, pattern_parts = self._parse_parts((pattern,))
if drv or root:
raise NotImplementedError("Non-relative patterns are unsupported")
if pattern[-1] in (self._flavour.sep, self._flavour.altsep):
pattern_parts.append('')
selector = _make_selector(tuple(pattern_parts), type(self))
for p in selector.select_from(self):
yield p
Expand All@@ -896,6 +898,8 @@ def rglob(self, pattern):
drv, root, pattern_parts = self._parse_parts((pattern,))
if drv or root:
raise NotImplementedError("Non-relative patterns are unsupported")
if pattern[-1] in (self._flavour.sep, self._flavour.altsep):
pattern_parts.append('')
selector = _make_selector(("**",) + tuple(pattern_parts), type(self))
for p in selector.select_from(self):
yield p
Expand Down
You are viewing a condensed version of this merge commit. You can view thefull changes here.

[8]ページ先頭

©2009-2025 Movatter.jp