]> granicus.if.org Git - python/commitdiff
Issue 24454: Added whatsnew entry, removed __getitem__ from match_methods. Thanks...
authorEric V. Smith <eric@trueblade.com>
Sun, 11 Sep 2016 13:50:47 +0000 (09:50 -0400)
committerEric V. Smith <eric@trueblade.com>
Sun, 11 Sep 2016 13:50:47 +0000 (09:50 -0400)
Doc/whatsnew/3.6.rst
Modules/_sre.c

index a3f216f507e70aa3c042e42dc951205b56acb358..d0aad49797daf9f85de6c8f228b83cc5052782cb 100644 (file)
@@ -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
 --------
index e4372bedb6e7afdf23af3d40e26ec6899ea9a21a..a25d935a20389a7fb2aa281c713f55dc7b0d00e0 100644 (file)
@@ -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}
 };