[issue28765] _sre.compile(): be more strict on types of indexgroup and groupindex

STINNER Victor report at bugs.python.org
Wed Nov 23 05:23:19 EST 2016


STINNER Victor added the comment:

> Should we check that code is exact list?

Do you mean a tuple for indexgroup? Yeah, it also seems worth it.

I just checked:
---
class Tuple(tuple):
    def __getitem__(self, index):
        return 9

a = Tuple([1, 2, 3])
print(a[0])
---

Output:
---
9
---

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28765>
_______________________________________


More information about the Python-bugs-list mailing list