gh-140922: Document fnmatch.translate \Z to \z change in 3.14#144457
gh-140922: Document fnmatch.translate \Z to \z change in 3.14#144457kovan wants to merge 1 commit intopython:mainfrom
Conversation
Add versionchanged note explaining that fnmatch.translate() now generates regular expressions using \z instead of \Z. Both are equivalent; \Z is still accepted for compatibility. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
picnixz
left a comment
There was a problem hiding this comment.
Please, always read the issue description and its corresponding thread. The indication should have gone first into "Porting to 3.14" notes as this one is an implementation detail, though I think it's also fine to have it as a "versionchanged".
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
There were no An alternative is to simply restore |
|
Ok, let's just close this and keep it as an implementation detail. Strictly speaking, users shouldn't really play with the generated regex, or if they want to play with it, they should be careful. We can still discuss whether we restore |
Summary
versionchanged:: 3.14note tofnmatch.translate()documentation\zinstead of\Z\Zis still accepted for compatibilitySource verification
Lib/fnmatch.py:188that\zis usedadd0ca9ea00made this changeTest plan
make checkpassed🤖 Generated with Claude Code
fnmatch.translatechanged in an undocumented way in Python 3.14 #140922📚 Documentation preview 📚: https://cpython-previews--144457.org.readthedocs.build/