GH-139282: Support recursive wildcard in `pathlib.PurePath.match()` by barneygale · Pull Request #139311 · python/cpython · GitHub
Skip to content

GH-139282: Support recursive wildcard in pathlib.PurePath.match()#139311

Open
barneygale wants to merge 2 commits intopython:mainfrom
barneygale:gh-139282-match-recursive
Open

GH-139282: Support recursive wildcard in pathlib.PurePath.match()#139311
barneygale wants to merge 2 commits intopython:mainfrom
barneygale:gh-139282-match-recursive

Conversation

@barneygale
Copy link
Copy Markdown
Contributor

@barneygale barneygale commented Sep 24, 2025

Add support for the recursive wildcard ** in pathlib.PurePath.match(). This is a behaviour change for anyone currently calling match() with ** in their pattern, but I reckon the vast majority of those users are expecting recursive matching and haven't realised that it's not working (:

This brings match() behaviour closer to full_match().


📚 Documentation preview 📚: https://cpython-previews--139311.org.readthedocs.build/

…h()`

Add support for the recursive wildcard `**` in `pathlib.PurePath.match()`.
This is a behaviour change for anyone currently calling `match()` with `**`
in their pattern, but I reckon the vast majority of those users are
expecting recursive matching and haven't realised that it's not working (:

This brings `match()` behaviour closer to `full_match()`.
@barneygale
Copy link
Copy Markdown
Contributor Author

barneygale commented Sep 24, 2025

@barneygale barneygale requested a review from zooba October 10, 2025 22:31
@barneygale
Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants