]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-91524: Speed up the regular expression substitution (#91525)
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 23 Oct 2022 22:57:30 +0000 (01:57 +0300)
committerGitHub <noreply@github.com>
Sun, 23 Oct 2022 22:57:30 +0000 (15:57 -0700)
commit75a6fadf369315b27e12f670e6295cf2c2cf7d7e
treecbf2004f870017f90874dc721e928da9412bab50
parent176b6c57be70fb70fd0563813a87822545eb4bbf
gh-91524: Speed up the regular expression substitution (#91525)

Functions re.sub() and re.subn() and corresponding re.Pattern methods
are now 2-3 times faster for replacement strings containing group references.

Closes #91524

Primarily authored by serhiy-storchaka Serhiy Storchaka
Minor-cleanups-by: Gregory P. Smith [Google] <greg@krypto.org>
Doc/whatsnew/3.12.rst
Lib/re/__init__.py
Lib/re/_constants.py
Lib/re/_parser.py
Misc/NEWS.d/next/Library/2022-04-14-08-37-16.gh-issue-91524.g8PiIu.rst [new file with mode: 0644]
Modules/_sre/clinic/sre.c.h
Modules/_sre/sre.c
Modules/_sre/sre.h
Modules/_sre/sre_constants.h