Skip to content

gh-140922: Document fnmatch.translate \Z to \z change in 3.14#144457

Closed
kovan wants to merge 1 commit into
python:mainfrom
kovan:gh-140922-fnmatch-translate-versionchanged
Closed

gh-140922: Document fnmatch.translate \Z to \z change in 3.14#144457
kovan wants to merge 1 commit into
python:mainfrom
kovan:gh-140922-fnmatch-translate-versionchanged

Conversation

@kovan

@kovan kovan commented Feb 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds versionchanged:: 3.14 note to fnmatch.translate() documentation
  • Explains that the generated regular expression now uses \z instead of \Z
  • Notes that both are equivalent and \Z is still accepted for compatibility

Source verification

  • Verified in Lib/fnmatch.py:188 that \z is used
  • Commit add0ca9ea00 made this change

Test plan

  • make check passed

🤖 Generated with Claude Code


📚 Documentation preview 📚: https://cpython-previews--144457.org.readthedocs.build/

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 picnixz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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".

cc @serhiy-storchaka

@bedevere-app

bedevere-app Bot commented Feb 4, 2026

Copy link
Copy Markdown

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 I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@serhiy-storchaka

Copy link
Copy Markdown
Member

There were no versionchanged for past changes, so I do not think it is worth to add it for this one.

An alternative is to simply restore \Z.

@picnixz

picnixz commented Feb 4, 2026

Copy link
Copy Markdown
Member

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 \Z or not, but that could be an issue as we are quite a few releases in 3.14 (and thus some people may have already changed their code).

@picnixz picnixz closed this Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting changes docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants