-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Closed
Labels
Description
Documentation
I'm confused by the following notice:
Deprecated since version 3.11: Group id containing anything except ASCII digits.
After some digging I found the related PR.
With the notice as is I would assume that non-ASCII digits would be interpreted as a name, but after reading the PR it's obvious that it cannot be the case since names must contain ASCII letters and digits.
Perhaps it's better to rewrite it to match the notice for re.sub:
Deprecated since version 3.11: Group id containing anything except ASCII digits. Group names containing non-ASCII characters in bytes replacement strings.
See https://discuss.python.org/t/cryptic-3-11-deprecation-notice-in-the-re-module-doc/20903
Metadata
Metadata
Assignees
Labels
Projects
Milestone
Relationships
Development
Select code repository
Activity
pythongh-99308: Fix wording of the deprecation notice in re for 3.12
bedevere-bot commentedon Nov 10, 2022
GH-99310 is a backport of this pull request to the 3.11 branch.
pythongh-99308: Fix wording of the deprecation notice in re for 3.11
gvanrossum commentedon Nov 10, 2022
Maybe @CAM-Gerlach can review this? It does look like the original PR left some unclear deprecation notices.
CAM-Gerlach commentedon Nov 10, 2022
I'd reviewed the linked #99311 previously, but while I didn't explicitly state it in my initial review, yeah the textual clarifications I suggest there should also be made in the other two places from the same original PR where a change in the allowed values for
name
in patterns and replacements is mentioned.Also, since this was an unusual case where a deprecation made in one released turned into a change in the next, the changes will likely need to be manually backported with the
cherry-picker
script. While doing so, it would be really helpful to change the.. deprecated
directive todeprecated-removed
, to clarify both human-readibly and programmatically that the planned removal of support for the non-ASCII/numeric values will be in the very next version, which is not currently stated anywhere (and also isn't the standard deprecation policy).pythongh-99308: Fix typos and make wording consistent
pythongh-99308: Fix missing dot.
gh-99308: Clarify re docs for byte pattern group names (#99311)
Merged main into regmachine branch (#50)
hauntsaninja commentedon Jan 6, 2023
It looks like the wording in #99311 was not backported to 3.11, because of some confusion: the wording change was to "version changed" which is 3.12, but on the 3.11 branch it exists as this deprecation notice.
A corresponding PR to the 3.11 branch matching the wording is welcome!
pythongh-99308: Fix wording of the deprecation notice in re for 3.11
pythongh-99308: Fix wording of the deprecation notice in re for 3.11
bedevere-bot commentedon Jan 12, 2023
GH-101001 is a backport of this pull request to the 3.11 branch.
[3.11] Clarify re docs for byte pattern group names (GH-99308) (#101001)