[docs] RegexObject findall, finditer docs misleading
chisophugis at gmail.com
Wed May 25 20:36:56 CEST 2011
On RegexObjects, finditer returns an iterator over MatchObjects, whereas
findall returns a list of *strings*. This isn't mentioned anywhere in their
documentation, but it is a pretty big distinction.
To my knowledge, they are interconnected by this equivalence:
re_obj.findall(string, pos, endpos) <=> [m.group(0) for m in
re_obj.finditer(string, pos, endpos)]
Hopefully that can be clarified, because it tripped me up, and I'm sure I'm
not the only one!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the docs