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

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

[Python-Dev] Termination of two-arg iter() [Python-Dev] Termination of two-arg iter()Tim Peters tim.one@comcast.net
Sat, 13 Jul 2002 23:19:43 -0400
[jepler@unpythonic.net]
> 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?

Oh yes.  OTOH, its current behavior isn't defined well enough anywhere
(short of reading the source code) that raising StopIteration on the second
call today could be called "a bug" either.





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