python -- callable iterator size?

Viewed 15948

I am looking through some text file for a certain string with the method.

re.finditer(pattern,text) I would like to know when this returns nothing. meaning that it could find nothing in the passed text.

I know that callable iterators, have next() and __iter__

I would like to know if I could get the size or find out if it returns no string matching my pattern.

6 Answers
Related