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/2002-July/026291.html below:

[Python-Dev] Single- vs. Multi-pass iterability

[Python-Dev] Single- vs. Multi-pass iterability [Python-Dev] Single- vs. Multi-pass iterabilityDavid Abrahams David Abrahams" <david.abrahams@rcn.com
Thu, 11 Jul 2002 16:10:28 -0400
The real reason to be able to introspect is so that you can handle both
kinds.
Even if you're willing to destroy the data by examining it, if you know you
have a single-pass sequence, you might need to copy its elements into a
multi-pass sequence (e.g. file.lines()) in order to get your work done.


From: "Guido van Rossum" <guido@python.org>
> > I don't know if we need them, but I'm certainly finding that not having
> > some more information is difficult for me. If I need to make multiple
> > passes over the information in a generalized iterable object, the only
> > solution AFAICT is to unconditionally copy all the information into a
list
> > first.
>
> Or you could just document "this argument must support multiple
> independent iterators."






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