-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-91760: Deprecate group names and numbers which will be invalid in future #91794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
serhiy-storchaka
merged 8 commits into
python:main
from
serhiy-storchaka:re-group-name-deprecate
Apr 30, 2022
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a0093c0
gh-91760: Deprecate group names and numbers which will be invalid in …
serhiy-storchaka a38e371
Merge branch 'main' into re-group-name-deprecate
serhiy-storchaka bb7272b
Minimize diff.
serhiy-storchaka 9965ab2
Simplify tests.
serhiy-storchaka 6a594ed
Merge branch 'main' into re-group-name-deprecate
serhiy-storchaka 543d995
Remove restriction for group numerical reference starting with 0.
serhiy-storchaka 7b95731
Update Doc/whatsnew/3.11.rst
serhiy-storchaka 3b63543
Merge branch 'main' into re-group-name-deprecate
serhiy-storchaka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.