Implement pure Path properties: drive, root, anchor, is_reserved, and match #1316
All Vouch review confidence checks passed
Residual risk 0.24 = Change Risk (0.43) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 368 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.354
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #1316"
general
weight: 0.35
davidhewitt
Description
Implements standard pure
pathlib.Pathproperties and methods (drive,root,anchor,is_reserved(), andmatch()), closing compatibility gaps identified in #1060 and documented inlimitations/pathlib.md.Context: Downstream commit
BucketHeadP65/ai-studio@b0ec4fadocumented these missing attributes as active compatibility blockers in sandboxed agent workflows.Summary of Changes:
Path.drive: Returns""for POSIX paths.Path.root: Returns"/"for absolute paths and""for relative paths.Path.anchor: Returns"/"for absolute paths and""for relative paths (drive + root).Path.is_reserved(): ReturnsFalseon POSIX systems; validates argument arity (takes 0 arguments).Path.match(path_pattern,, case_sensitive=None): Matches paths against glob-style wildcard patterns usingSegmentPatternwith CPython 3.14 component-wise matching semantics and case-sensitivity handling.intern.rs: RegisteredAnchor,Drive,IsReserved,PathPattern, andRootinStaticStrings.limitations/pathlib.md: Updated documentation of pure methods and visible argument arity count.pathlib__pure.py*: Added test cases verifying parity with CPython across all new attributes, methods, edge cases, and argument errors.<!-- This is an auto-generated description by cubic. -->
---
Summary by cubic
Implements the pure
pathlib.Pathpropertiesdrive,root,anchorand theis_reserved()andmatch()methods, closing compatibility gaps identified in#1060and documented inlimitations/pathlib.md.driveis always""on POSIX;rootandanchorreturn"/"for absolute paths and""otherwise;is_reserved()always returnsFalseand rejects extra arguments.match()follows CPython 3.14 component-wise matching viaSegmentPattern, supports thecase_sensitivekeyword, and raisesValueError: empty patternfor empty patterns ("",".").Path('/').match('')returnsFalse, matching CPython;match()also acceptsPathobjects as patterns and raisesTypeErrorfor other types.SegmentPatternpolls theResourceTrackerto cap backtracking on pathological patterns and documents theResourceErrorit can raise.<sup>Written for commit 2aada52b171b546f2c639a52e4bf662e0798b7dd. Summary will update on new commits.</sup>
<a href="https://cubic.dev/pr/pydantic/monty/pull/1316?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>
<!-- End of auto-generated description by cubic. -->