Skip to content

Conversation

barneygale
Copy link
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
Contributor Author

barneygale commented Sep 24, 2025

Is it worth putting this behind a new full argument?

(I'm leaning towards "no", because there surely aren't many users who employ ** in their patterns and expect non-recursive matching)

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.

1 participant