[issue19536] MatchObject should offer __getitem__()

2016-06-26 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the detailed report! Issue 24454 is actually a duplicate of this but it has a patch and the idea was discussed by several core developers there. I'm going to close this one. -- nosy: +berker.peksag resolution: -> duplicate stage: needs patch

[issue19536] MatchObject should offer __getitem__()

2013-11-12 Thread Ezio Melotti
Ezio Melotti added the comment: I think the idea is to eventually deprecate the .group() API. -- ___ Python tracker ___ ___ Python-bug

[issue19536] MatchObject should offer __getitem__()

2013-11-10 Thread Greg Ward
Greg Ward added the comment: >>> import this [...] There should be one-- and preferably only one --obvious way to do it. -- nosy: +gward ___ Python tracker ___ __

[issue19536] MatchObject should offer __getitem__()

2013-11-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: We discussed this recently on #python-dev, and I don't think that it's worth to add indexing to match object. It will be confused that len(match) != len(match.groups()). I don't know any use case for indexing, it doesn't add anything new except yet one way t

[issue19536] MatchObject should offer __getitem__()

2013-11-09 Thread Ezio Melotti
Ezio Melotti added the comment: This is something that the regex module already has, and since it is/was supposed to replace the re module in stdlib, I've been holding off to add to re for a long time. We also discussed this recently on #python-dev, and I think it's OK to add it, as long as i

[issue19536] MatchObject should offer __getitem__()

2013-11-09 Thread Brandon Rhodes
Changes by Brandon Rhodes : -- versions: +Python 3.4 -Python 3.5 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue19536] MatchObject should offer __getitem__()

2013-11-09 Thread Brandon Rhodes
New submission from Brandon Rhodes: Regular expression re.MatchObject objects are sequences. They contain at least one “group” string, possibly more, which are integer-indexed starting at zero. Today, groups can be accessed in one of two ways. (1) You can call the method match.group(N). (2) You