Skip to content

Key matcher pattern cache by normalizer identity - #269

Open
blouirts123 wants to merge 1 commit into
jaraco:mainfrom
blouirts123:fix/pattern-normalizer-cache
Open

blouirts123 wants to merge 1 commit into
jaraco:mainfrom
blouirts123:fix/pattern-normalizer-cache

Conversation

@blouirts123

Copy link
Copy Markdown

Reusing one matchers.Pattern('*.TXT') across ntpath and posixpath Path variants can miss File.TXT on the second traversal in either order. The normalized glob is cached without recording which normalizer produced it.

Key a single cache entry by normalizer identity and publish the key/value together. Preserve repeated bound-method cache hits, avoid user-defined callable equality, and discard transient cache state during pickling so subclass dictionary/slot state still round-trips. Add module-order, callable-metadata and pickle regressions plus a Towncrier fragment.

Validation: root and independent focused class: 14 passed; filtered functional suite: 129 passed, 7 skipped, 12 symlink-dependent tests deselected. Docs and formatting pass; final changed-line coverage is 100% (82 lines). Full tox remains blocked locally by existing Ruff/mypy findings and Windows symlink privileges. Controlled baseline comparison reproduced those failures, and final diagnostics add no Ruff finding or changed-file type error. A concurrent mixed-normalizer probe and fragment draft rendering also pass. No performance claim is made.

@blouirts123
blouirts123 marked this pull request as draft October 16, 2026 04:52
@blouirts123
blouirts123 marked this pull request as ready for review October 16, 2026 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant