A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-October/018143.html below:

[Python-Dev] iterator support for SRE?

[Python-Dev] iterator support for SRE?Fredrik Lundh fredrik@pythonware.com
Fri, 26 Oct 2001 11:38:29 +0200
guido wrote:
> > how about adding a "finditer" method, which takes care of
> > the low-level setup:
> >
> > >>> for match in p.finditer(somestring):
> > >>>     print match.groups()
> >
> > or should we just make the scanner factory an official part
> > of the SRE interface?
>
> Or both?  The scanner interface seems vaguely useful as a low-level
> tool to create other higher-level variants; but the finditer() call
> seems to nicely capture a common case.

as you might have noticed, I went ahead and checked in code
for "finditer".  nobody has complained this far ;-)

isn't "iterfind" a better name, btw?  more like "iterkeys" (etc).

if nobody complains, I'll change the name, and check in some
documentation.

:::

will have to think about scanner; I agree that it may seem to
be vaguely useful, but cannot think of a use case that isn't
better handled by findall/split/sub or iterfind.  can anyone?

</F>





RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4