Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b569086

Browse files
committed
Issue 24454: Added whatsnew entry, removed __getitem__ from match_methods. Thanks Serhiy Storchaka.
1 parent b7e3535 commit b569086

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

Doc/whatsnew/3.6.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,10 @@ Added support of modifier spans in regular expressions. Examples:
724724
``'(?i)g(?-i:v)r'`` matches ``'GvR'`` and ``'gvr'``, but not ``'GVR'``.
725725
(Contributed by Serhiy Storchaka in :issue:`433028`.)
726726

727+
Match object groups can be accessed by ``__getitem__``, which is
728+
equivalent to ``group()``. So ``mo['name']`` is now equivalent to
729+
``mo.group('name')``. (Contributed by Eric Smith in :issue:`24454`.)
730+
727731

728732
readline
729733
--------

Modules/_sre.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2733,7 +2733,6 @@ static PyMethodDef match_methods[] = {
27332733
_SRE_SRE_MATCH_EXPAND_METHODDEF
27342734
_SRE_SRE_MATCH___COPY___METHODDEF
27352735
_SRE_SRE_MATCH___DEEPCOPY___METHODDEF
2736-
{"__getitem__", (PyCFunction)match_getitem, METH_O|METH_COEXIST, match_getitem_doc},
27372736
{NULL, NULL}
27382737
};
27392738

0 commit comments

Comments
 (0)