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)

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

Hi Steve, I've tagged you for review as you helped with #114350, hope that's alright. Thanks :)

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