-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gh-91760: Deprecate group names and numbers which will be invalid in …
…future (GH-91794) Only sequence of ASCII digits will be accepted as a numerical reference. The group name in bytes patterns and replacement strings could only contain ASCII letters and digits and underscore.
- Loading branch information
1 parent
6d0d547
commit 19dca04
Showing
5 changed files
with
112 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -417,6 +417,9 @@ The special characters are: | |
| | * ``\1`` | | ||
+---------------------------------------+----------------------------------+ | ||
|
||
.. deprecated:: 3.11 | ||
Group names containing non-ASCII characters in bytes patterns. | ||
|
||
.. index:: single: (?P=; in regular expressions | ||
|
||
``(?P=name)`` | ||
|
@@ -486,6 +489,9 @@ The special characters are: | |
will match with ``'<[email protected]>'`` as well as ``'[email protected]'``, but | ||
not with ``'<[email protected]'`` nor ``'[email protected]>'``. | ||
|
||
.. deprecated:: 3.11 | ||
Group *id* containing anything except ASCII digits. | ||
|
||
|
||
The special sequences consist of ``'\'`` and a character from the list below. | ||
If the ordinary character is not an ASCII digit or an ASCII letter, then the | ||
|
@@ -995,6 +1001,10 @@ form. | |
Empty matches for the pattern are replaced when adjacent to a previous | ||
non-empty match. | ||
|
||
.. deprecated:: 3.11 | ||
Group *id* containing anything except ASCII digits. | ||
Group names containing non-ASCII characters in bytes replacement strings. | ||
|
||
|
||
.. function:: subn(pattern, repl, string, count=0, flags=0) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
Misc/NEWS.d/next/Library/2022-04-21-19-46-03.gh-issue-91760.zDtv1E.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
More strict rules will be applied for numerical group references and group | ||
names in regular expressions. For now, a deprecation warning is emitted for | ||
group references and group names which will be errors in future Python | ||
versions. |