You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Consolidate pathlib.PurePath.match() and full_match() #139282
Whichever fool (me!) added pathlib.PurePath.full_match() should have given more consideration to adding an argument to match() instead of a new method. The behaviour isn't that different. The fact we have two very similar methods is a bit of a wart. It's hopefully not too late to rectify.
match, the original. fullmatch, added in 3.13.
Both have signature pattern, *, case_sensitive=None.
Match had these restrictions and difference:
empty patterns aren’t allowed (ValueError is raised), the recursive wildcard “**” isn’t supported (it acts like non-recursive “*”), and if a relative pattern is provided, then matching is done from the right:
Since added recently, fullmatch might not have great usage yet. In 3.15, could add, for instance, 'full=False' to match and change doc to match. Deprecate 'fullmatch', with removal multiple versions away, such as 5 (no hurry).
Activity
terryjreedy commentedon Sep 24, 2025
match, the original.
fullmatch, added in 3.13.
Both have signature
pattern, *, case_sensitive=None.Match had these restrictions and difference:
Since added recently, fullmatch might not have great usage yet. In 3.15, could add, for instance, 'full=False' to match and change doc to match. Deprecate 'fullmatch', with removal multiple versions away, such as 5 (no hurry).
pythonGH-139282: Support recursive wildcard in `pathlib.PurePath.matc…
barneygale commentedon Sep 24, 2025
Thank you Terry for the helpful guidance :)
Merge branch 'main' into pythongh-139282-match-recursive