alex23 wrote:
Gerard Flanagan <grflana...@gmail.com> wrote:
def count(text, *args):

Other than the ability to handle multiple substrings, you do realise
you've effectively duplicated str.count()?

I realise that calling this count function with a single argument would be functionally identical to calling str.count(), yes. But I can imagine the situation of wanting to find multiple (disjoint) substrings. Is there a reason for preferring multiple calls to str.count() in such a case? Or is there a more obvious approach?

> Gerard Flanagan <grflana...@gmail.com> wrote:
> re.findall?

Forget that, that was stupid.



--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to