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/026461.html below:

[Python-Dev] Termination of two-arg iter()

[Python-Dev] Termination of two-arg iter()Guido van Rossum guido@python.org
Sat, 13 Jul 2002 20:42:14 -0400
> > So I misremembered, and Tim didn't read the PEP closely enough. :-)
> > 
> > > I'm happy to leave this be: the docs match the implemenation, I'm
> > > sure *someone* relies on that by now, and the behavior is easy to
> > > explain as-is.
> > 
> > Hm.  Given what the PEP says, I'm ready to have this fixed (even in
> > 2.2.2).  I can't call code relying on this sane.
> 
> What about this example?
> >>> l = []
> >>> li = iter(l)
> >>> li.next()
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> StopIteration
> >>> l.extend([1, 2, 3])
> >>> li.next()
> 1
> 
> does the list iterator violate the proposed behavior?

Alternatively, we could change the PEP to make this officially
undefined (or at least up to the iterator used).  I'm not sure which I
like better -- the PEP or reality. :-)

--Guido van Rossum (home page: http://www.python.org/~guido/)




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