A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2002-July/026734.html below:

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

[Python-Dev] Re: Single- vs. Multi-pass iterability [Python-Dev] Re: Single- vs. Multi-pass iterabilityBarry A. Warsaw barry@zope.com
Thu, 18 Jul 2002 18:05:31 -0400
>>>>> "GvR" == Guido van Rossum <guido@python.org> writes:

    >> Container-like objects usually support protocol 1.  Iterators are
    >> currently required to support both protocols.  The semantics of
    >> iteration come only from protocol 2; protocol 1 is present to make
    >> iterators behave like sequences.  But the analogy is weak -- unlike
    >> ordinary sequences, iterators are "sequences" that are destroyed by
    >> the act of looking at their elements.

    GvR> (I could do without the last sentence, since this expresses a
    GvR> value judgement rather than fact -- not a good thing to have
    GvR> in a PEP's "specification" section.)

What about:

    "...sequences.  Note that the act of looking at an iterator's
    elements mutates the iterator."

-Barry




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