Serhiy Storchaka added the comment:

This has already been discussed in other issues. Adding support of indexing 
opened a can of worms.

len() for match objects is ambiguous because of the group 0. Implementing len() 
will make the match object iterable, but in a way incompatible with issue9529 
(because of the group 0).

As for slicing and negative indexes, what is the use case? Do you know that you 
can get a tuple of groups by passing several arguments to group()? A regular 
expression usually has known set of groups, so you can just enumerate the 
indices (or better names) of needed groups (they can be not sequential).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29965>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to