This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author MizardX
Recipients MizardX
Date 2010-08-06.05:41:00
SpamBayes Score 0.00071425777
Marked as misclassified No
Message-id <1281073264.71.0.30355123146.issue9529@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2010-08-06 05:41:05MizardXsetrecipients: + MizardX
2010-08-06 05:41:04MizardXsetmessageid: <1281073264.71.0.30355123146.issue9529@psf.upfronthosting.co.za>
2010-08-06 05:41:02MizardXlinkissue9529 messages
2010-08-06 05:41:01MizardXcreate