Message113074
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. |
|
Date |
User |
Action |
Args |
2010-08-06 05:41:05 | MizardX | set | recipients:
+ MizardX |
2010-08-06 05:41:04 | MizardX | set | messageid: <1281073264.71.0.30355123146.issue9529@psf.upfronthosting.co.za> |
2010-08-06 05:41:02 | MizardX | link | issue9529 messages |
2010-08-06 05:41:01 | MizardX | create | |
|