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 could write 
something like the following:

for key,value in re.finditer(r'(\w+):(\w+)', text):
  data[key] = value

2) Make re.findall return an iterator over tuples. This would decrease the 
memory footprint.

----------
components: Regular Expressions
messages: 113074
nosy: MizardX
priority: normal
severity: normal
status: open
title: Converge re.findall and re.finditer

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

Reply via email to