cpython: 29764a7bd6ba (original) (raw)

Mercurial > cpython

changeset 86508:29764a7bd6ba

Issue #17087: Improved the repr for regular expression match objects. [#17087]

Serhiy Storchaka storchaka@gmail.com
date Sun, 20 Oct 2013 13:13:31 +0300
parents 727107721f4f
children 84a8b797c5c5 7f4e0c869c2e
files Lib/test/test_re.py Misc/NEWS Modules/_sre.c
diffstat 3 files changed, 41 insertions(+), 1 deletions(-)[+] [-] Lib/test/test_re.py 22 Misc/NEWS 2 Modules/_sre.c 18

line wrap: on

line diff

--- a/Lib/test/test_re.py +++ b/Lib/test/test_re.py @@ -1104,6 +1104,28 @@ class ReTests(unittest.TestCase): self.assertEqual(re.compile(pattern, re.S).findall(b'xyz'), [b'xyz'], msg=pattern)

+

+ def test_bug_2537(self): # issue 2537: empty submatches

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -62,6 +62,8 @@ Core and Builtins Library ------- +- Issue #17087: Improved the repr for regular expression match objects. +

--- a/Modules/_sre.c +++ b/Modules/_sre.c @@ -3637,6 +3637,22 @@ match_regs_get(MatchObject *self) return match_regs(self); } +static PyObject * +match_repr(MatchObject *self) +{

+} + + static PyGetSetDef match_getset[] = { {"lastindex", (getter)match_lastindex_get, (setter)NULL}, {"lastgroup", (getter)match_lastgroup_get, (setter)NULL}, @@ -3665,7 +3681,7 @@ static PyTypeObject Match_Type = { 0, /* tp_getattr / 0, / tp_setattr / 0, / tp_reserved */