[docs] RegexObject findall, finditer docs misleading

Sandro Tosi sandro.tosi at gmail.com
Wed Jun 1 00:07:04 CEST 2011


Hello Sean,

On Wed, May 25, 2011 at 20:36, Sean Silva <chisophugis at gmail.com> wrote:
> http://docs.python.org/library/re.html#re.RegexObject.findall
> 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.

It's not explicitly mentioned, but this functions have clear remark
that they are similar to "other" functions, f.e.:

findall(string[, pos[, endpos]])
Similar to the findall() function

and following the "findall()" like you end up to:

re.findall(pattern, string[, flags])
Return all non-overlapping matches of pattern in string, as a list of strings.

The same applies for finditer().

Regards,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi


More information about the docs mailing list