New submission from Jeroen Demeyer: ``` >>> class zero(object): ... def __index__(self): ... return 0 ... >>> z = zero() >>> import re >>> p = re.compile('(a)b') >>> m = p.match('ab') >>> m.group(0) 'ab' >>> m.group(z) Traceback (most recent call last): File "<stdin>", line 1, in <module> IndexError: no such group ```
---------- components: Regular Expressions files: re_match_index.patch keywords: patch messages: 266817 nosy: ezio.melotti, jdemeyer, mrabarnett priority: normal severity: normal status: open title: re match.group should support __index__ versions: Python 2.7 Added file: http://bugs.python.org/file43084/re_match_index.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27177> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com