From b5690864baf4fce678d80639a6ed9e239bc0065a Mon Sep 17 00:00:00 2001 From: "Eric V. Smith" Date: Sun, 11 Sep 2016 09:50:47 -0400 Subject: Issue 24454: Added whatsnew entry, removed __getitem__ from match_methods. Thanks Serhiy Storchaka. --- Doc/whatsnew/3.6.rst | 4 ++++ Modules/_sre.c | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst index a3f216f..d0aad49 100644 --- a/Doc/whatsnew/3.6.rst +++ b/Doc/whatsnew/3.6.rst @@ -724,6 +724,10 @@ Added support of modifier spans in regular expressions. Examples: ``'(?i)g(?-i:v)r'`` matches ``'GvR'`` and ``'gvr'``, but not ``'GVR'``. (Contributed by Serhiy Storchaka in :issue:`433028`.) +Match object groups can be accessed by ``__getitem__``, which is +equivalent to ``group()``. So ``mo['name']`` is now equivalent to +``mo.group('name')``. (Contributed by Eric Smith in :issue:`24454`.) + readline -------- diff --git a/Modules/_sre.c b/Modules/_sre.c index e4372be..a25d935 100644 --- a/Modules/_sre.c +++ b/Modules/_sre.c @@ -2733,7 +2733,6 @@ static PyMethodDef match_methods[] = { _SRE_SRE_MATCH_EXPAND_METHODDEF _SRE_SRE_MATCH___COPY___METHODDEF _SRE_SRE_MATCH___DEEPCOPY___METHODDEF - {"__getitem__", (PyCFunction)match_getitem, METH_O|METH_COEXIST, match_getitem_doc}, {NULL, NULL} }; -- cgit v0.12