summaryrefslogtreecommitdiffstats
path: root/Modules/_sre.c
Commit message (Collapse)AuthorAgeFilesLines
* bpo-40268: Remove unused structmember.h includes (GH-19530)Victor Stinner2020-04-151-1/+1
| | | | | | If only offsetof() is needed: include stddef.h instead. When structmember.h is used, add a comment explaining that PyMemberDef is used.
* bpo-39943: Add the const qualifier to pointers on non-mutable PyUnicode ↵Serhiy Storchaka2020-04-111-6/+6
| | | | data. (GH-19345)
* bpo-40170: PyObject_NEW() becomes an alias to PyObject_New() (GH-19379)Victor Stinner2020-04-071-4/+4
| | | | | | | | | | | | The PyObject_NEW() macro becomes an alias to the PyObject_New() macro, and the PyObject_NEW_VAR() macro becomes an alias to the PyObject_NewVar() macro, to hide implementation details. They no longer access directly the PyTypeObject.tp_basicsize member. Exclude _PyObject_SIZE() and _PyObject_VAR_SIZE() macros from the limited C API. Replace PyObject_NEW() with PyObject_New() and replace PyObject_NEW_VAR() with PyObject_NewVar().
* bpo-39481: Implementation for PEP 585 (#18239)Guido van Rossum2020-04-071-0/+4
| | | | | | | | | | | | This implements things like `list[int]`, which returns an object of type `types.GenericAlias`. This object mostly acts as a proxy for `list`, but has attributes `__origin__` and `__args__` that allow recovering the parts (with values `list` and `(int,)`. There is also an approximate notion of type variables; e.g. `list[T]` has a `__parameters__` attribute equal to `(T,)`. Type variables are objects of type `typing.TypeVar`.
* bpo-39573: Clean up modules and headers to use Py_IS_TYPE() function (GH-18521)Dong-hee Na2020-02-171-1/+1
|
* bpo-39245: Switch to public API for Vectorcall (GH-18460)Petr Viktorin2020-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The bulk of this patch was generated automatically with: for name in \ PyObject_Vectorcall \ Py_TPFLAGS_HAVE_VECTORCALL \ PyObject_VectorcallMethod \ PyVectorcall_Function \ PyObject_CallOneArg \ PyObject_CallMethodNoArgs \ PyObject_CallMethodOneArg \ ; do echo $name git grep -lwz _$name | xargs -0 sed -i "s/\b_$name\b/$name/g" done old=_PyObject_FastCallDict new=PyObject_VectorcallDict git grep -lwz $old | xargs -0 sed -i "s/\b$old\b/$new/g" and then cleaned up: - Revert changes to in docs & news - Revert changes to backcompat defines in headers - Nudge misaligned comments
* bpo-39271: Remove dead assignment from pattern_subx (GH-17915)Alex Henrie2020-01-091-1/+0
|
* bpo-37483: add _PyObject_CallOneArg() function (#14558)Jeroen Demeyer2019-07-041-1/+1
|
* bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async ↵Jeroen Demeyer2019-05-311-6/+6
| | | | | | | | | (GH-13464) Automatically replace tp_print -> tp_vectorcall_offset tp_compare -> tp_as_async tp_reserved -> tp_as_async
* bpo-36251: Fix format strings used in match_repr() and stdprinter_repr(). ↵sth2019-03-101-1/+1
| | | | (GH-12252)
* bpo-35459: Use PyDict_GetItemWithError() instead of PyDict_GetItem(). (GH-11112)Serhiy Storchaka2019-02-251-32/+26
|
* bpo-34294: re module, fix wrong capturing groups in rare cases. (GH-11546)animalize2019-02-181-1/+1
| | | | | | Need to reset capturing groups between two SRE(match) callings in loops, this fixes wrong capturing groups in rare cases. Also add a missing index in re.rst.
* bpo-33029: Fix signatures of getter and setter functions. (GH-10746)Serhiy Storchaka2018-11-271-4/+4
| | | Fix also return type for few other functions (clear, releasebuffer).
* Simplified implementation of _sre.ascii_iscased(). (GH-9097)Sergey Fedoseev2018-09-121-6/+1
|
* bpo-34636: Use fast path for more chars in SRE category macros. (GH-9170)Sergey Fedoseev2018-09-111-3/+3
| | | | | | | When handling \s, \d, or \w (and their inverse) escapes in bytes regexes this a small but measurable performance improvement. <!-- issue-number: [bpo-34636](https://www.bugs.python.org/issue34636) --> https://bugs.python.org/issue34636 <!-- /issue-number -->
* _sre.c: Removed unused SRE_IS_ALNUM macro (GH-9090)Sergey Fedoseev2018-09-071-2/+0
|
* bpo-32308: Replace empty matches adjacent to a previous non-empty match in ↵Serhiy Storchaka2018-01-041-2/+2
| | | | re.sub(). (#4846)
* bpo-25054, bpo-1647489: Added support of splitting on zerowidth patterns. ↵Serhiy Storchaka2017-12-041-55/+22
| | | | | | (#4471) Also fixed searching patterns that could match an empty string.
* bpo-31690: Allow the inline flags "a", "L", and "u" to be used as group ↵Serhiy Storchaka2017-10-241-18/+19
| | | | flags for RE. (#3885)
* bpo-30397: Add re.Pattern and re.Match. (#1646)Serhiy Storchaka2017-10-041-16/+25
|
* bpo-30285: Optimize case-insensitive matching and searching (#1482)Serhiy Storchaka2017-05-091-0/+34
| | | | of regular expressions.
* bpo-30277: Replace _sre.getlower() with _sre.ascii_tolower() and ↵Serhiy Storchaka2017-05-051-9/+20
| | | | _sre.unicode_tolower(). (#1468)
* bpo-30215: Make re.compile() locale agnostic. (#1361)Serhiy Storchaka2017-05-051-0/+3
| | | | | | Compiled regular expression objects with the re.LOCALE flag no longer depend on the locale at compile time. Only the locale at matching time affects the result of matching.
* remove configure test for inline keyword (#1231)Benjamin Peterson2017-04-211-3/+1
| | | We require C99, so a configure test for this standard feature is not needed.
* bpo-10076: Compiled regular expression and match objects now are copyable. ↵Serhiy Storchaka2017-04-161-117/+14
| | | | (#1000)
* bpo-28765: Use concrete types API in _sre.c. (#1009)Serhiy Storchaka2017-04-161-37/+37
|
* bpo-29878: Add global instances of int for 0 and 1. (#852)Serhiy Storchaka2017-03-301-1/+1
|
* Issue #29444: Fixed out-of-bounds buffer access in the group() method ofSerhiy Storchaka2017-02-041-2/+7
|\ | | | | | | the match object. Based on patch by WGH.
| * Issue #29444: Fixed out-of-bounds buffer access in the group() method ofSerhiy Storchaka2017-02-041-2/+7
| |\ | | | | | | | | | the match object. Based on patch by WGH.
| | * Issue #29444: Fixed out-of-bounds buffer access in the group() method ofSerhiy Storchaka2017-02-041-2/+7
| | | | | | | | | | | | the match object. Based on patch by WGH.
* | | Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE whereverSerhiy Storchaka2017-01-231-8/+4
| | | | | | | | | | | | possible. Patch is writen with Coccinelle.
* | | Issue #29195: Removed support of deprecated undocumented keyword argumentsSerhiy Storchaka2017-01-131-72/+15
| | | | | | | | | | | | in methods of regular expression objects.
* | | Issue #28858: Remove _PyObject_CallArg1() macroVictor Stinner2016-12-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace _PyObject_CallArg1(func, arg) with PyObject_CallFunctionObjArgs(func, arg, NULL) Using the _PyObject_CallArg1() macro increases the usage of the C stack, which was unexpected and unwanted. PyObject_CallFunctionObjArgs() doesn't have this issue.
* | | Issue #28765: _sre.compile() now checks the type of groupindex and indexgroupVictor Stinner2016-11-221-3/+3
|/ / | | | | | | | | | | groupindex must a dictionary and indexgroup must be a tuple. Previously, indexgroup was a list. Use a tuple to reduce the memory usage.
* | Issue #28727: Optimize pattern_richcompare() for a==aVictor Stinner2016-11-221-0/+6
| | | | | | | | A pattern is equal to itself.
* | Issue #28727: Fix typo in pattern_richcompare()Victor Stinner2016-11-221-1/+1
| | | | | | | | Typo catched by Serhiy Storchaka, thanks!
* | Implement rich comparison for _sre.SRE_PatternVictor Stinner2016-11-211-6/+67
| | | | | | | | | | | | | | Issue #28727: Regular expression patterns, _sre.SRE_Pattern objects created by re.compile(), become comparable (only x==y and x!=y operators). This change should fix the issue #18383: don't duplicate warning filters when the warnings module is reloaded (thing usually only done in unit tests).
* | Issue 24454: Removed unused match_getitem_doc.Eric V. Smith2016-09-111-3/+0
| |
* | Issue 24454: Added whatsnew entry, removed __getitem__ from match_methods. ↵Eric V. Smith2016-09-111-1/+0
| | | | | | | | Thanks Serhiy Storchaka.
* | Issue 24454: Improve the usability of the re match object named group APIEric V. Smith2016-09-111-1/+18
| |
* | replace Py_(u)intptr_t with the c99 standard typesBenjamin Peterson2016-09-061-7/+7
| |
* | Rename _PyObject_FastCall() to _PyObject_FastCallDict()Victor Stinner2016-08-221-1/+1
| | | | | | | | | | | | | | | | Issue #27809: * Rename _PyObject_FastCall() function to _PyObject_FastCallDict() * Add _PyObject_FastCall(), _PyObject_CallNoArg() and _PyObject_CallArg1() macros calling _PyObject_FastCallDict()
* | pattern_subx() now uses fast callVictor Stinner2016-08-191-8/+1
| | | | | | | | Issue #27128.
* | merge 3.5 (#27774)Benjamin Peterson2016-08-161-3/+1
|\ \ | |/
| * merge 3.4 (#27774)Benjamin Peterson2016-08-161-3/+1
| |\
| | * merge 3.3 (#27774)Benjamin Peterson2016-08-161-3/+1
| | |\
| | | * do not decref value borrowed from list (closes #27774)Benjamin Peterson2016-08-161-3/+1
| | | |
* | | | - Issue #27332: Fixed the type of the first argument of module-level functionsSerhiy Storchaka2016-07-071-6/+6
|\ \ \ \ | |/ / / | | | | | | | | generated by Argument Clinic. Patch by Petr Viktorin.
| * | | Issue #27332: Fixed the type of the first argument of module-level functionsSerhiy Storchaka2016-07-071-6/+6
| | | | | | | | | | | | | | | | generated by Argument Clinic. Patch by Petr Viktorin.
* | | | Issue #27177: Match objects in the re module now support index-like objectsSerhiy Storchaka2016-06-181-2/+3
| | | | | | | | | | | | | | | | as group indices. Based on patches by Jeroen Demeyer and Xiang Zhang.