10000 gh-91524: Speed up the regular expression substitution by serhiy-storchaka · Pull Request #91525 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-91524: Speed up the regular expression substitution #91525

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
merged 11 commits into from
Oct 23, 2022
Merged
Prev Previous commit
Next Next commit
improve the _sre.template docstring.
  • Loading branch information
gpshead committed Oct 23, 2022
commit 00d5e12ade861d5186738c71d47aab290db26d50
10 changes: 8 additions & 2 deletions Modules/_sre/clinic/sre.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Modules/_sre/sre.c
Original file line number Diff line number Diff line change
Expand Up @@ -1529,13 +1529,16 @@ _sre.template

pattern: object
template: object(subclass_of="&PyList_Type")
A list containing interleaved literal strings (str or bytes) and group
indices (int), as returned by re._parser.parse_template():
[literal1, group1, ..., literalN, groupN]
/

[clinic start generated code]*/

static PyObject *
_sre_template_impl(PyObject *module, PyObject *pattern, PyObject *template)
/*[clinic end generated code: output=d51290e596ebca86 input=56d2d1895cd04d9a]*/
/*[clinic end generated code: output=d51290e596ebca86 input=af55380b27f02942]*/
{
/* template is a list containing interleaved literal strings (str or bytes)
* and group indices (int), as returned by _parser.parse_template:
Expand Down
0