MizardX miza...@gmail.com added the comment:
I don't think (1) would break any code. finditer() would still generate
match-objects.
The only time you would be discard the match-object, is if you try to do a
destructuring bind in, e.g. a loop. This shouldn't be unexpected for the
programmer.
Matthew Barnett pyt...@mrabarnett.plus.com added the comment:
Ah, I see what you mean. I still think you're wrong, though! :-)
The 'for' loop is doing is basically this:
it = re.finditer(r'(\w+):(\w+)', text)
try:
while True:
match_object = next(it)
#
Matthew Barnett pyt...@mrabarnett.plus.com added the comment:
(1) would break existing code. It would also mean that you wouldn't have access
to the start and end positions of the matches either.
(2) would also break existing code which is expecting a list. It's like the
change that happened
New submission from MizardX miza...@gmail.com:
re.findall and re.finditer has very different signature. One iterates over
match objects, the other returns a list of tuples.
I can think of two ways to make them more similar:
1) Make match objects iterable over their captures. With this, you
Changes by Ezio Melotti ezio.melo...@gmail.com:
--
nosy: +ezio.melotti, moreati, mrabarnett, timehorse
stage: - needs patch
type: - behavior
versions: +Python 3.2
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9529