changeset: 103637:3265247e08f0 user: Eric V. Smith date: Sun Sep 11 09:50:47 2016 -0400 files: Doc/whatsnew/3.6.rst Modules/_sre.c description: Issue 24454: Added whatsnew entry, removed __getitem__ from match_methods. Thanks Serhiy Storchaka. diff -r c45088b19342 -r 3265247e08f0 Doc/whatsnew/3.6.rst --- a/Doc/whatsnew/3.6.rst Sun Sep 11 16:47:59 2016 +0300 +++ b/Doc/whatsnew/3.6.rst Sun Sep 11 09:50:47 2016 -0400 @@ -724,6 +724,10 @@ ``'(?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 -r c45088b19342 -r 3265247e08f0 Modules/_sre.c --- a/Modules/_sre.c Sun Sep 11 16:47:59 2016 +0300 +++ b/Modules/_sre.c Sun Sep 11 09:50:47 2016 -0400 @@ -2733,7 +2733,6 @@ _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} };