gh-139580: Clarify pathlib full_match recursive pattern docs#151479
Open
harjothkhara wants to merge 1 commit into
Open
gh-139580: Clarify pathlib full_match recursive pattern docs#151479harjothkhara wants to merge 1 commit into
harjothkhara wants to merge 1 commit into
Conversation
Documentation build overview
|
753a0d3 to
54f4826
Compare
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
54f4826 to
303854b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes gh-139580.
Summary
Clarify the
PurePath.full_match()documentation for recursive**patterns.In particular,
/a/**matches paths with a slash and following segment such as/a/b, but not/aitself.This is a docs-only fix matching the existing pathlib behavior. The blast radius
is limited to
Doc/library/pathlib.rst; no runtime behavior changes are made.Verification
Real behavior check:
./python.exe -c "from pathlib import Path; cases = ('/a', '/a/b', '/a/'); [print(f\"Path({case!r}) normalizes to {str(Path(case))!r}; full_match('/a/**') -> {Path(case).full_match('/a/**')}\") for case in cases]"Output:
Docs checks:
Results:
make -C Doc html SOURCES=library/pathlib.rst SPHINXOPTS="-q"passed.make -C Doc doctest SOURCES=library/pathlib.rst SPHINXOPTS="-q"passed.git diff --checkpassed.