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

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

[Python-Dev] Termination of two-arg iter() [Python-Dev] Termination of two-arg iter()Guido van Rossum guido@python.org
Mon, 15 Jul 2002 11:18:59 -0400
> StopIterator is a sink state for dict iterators if I don't change the
> size of the dict.  Shouldn't list and dict iterators should behave
> similarly for mutation (or at least resizing) between .next() calls?

No, mutating a list while the iterator is not exhausted is perfectly
well defined: the iterator's state has the next index to try.  This is
totally predictable, and useful or not depending on what you're trying
to do.  The dict iterator tests for mutating the dict because the
rehashing possibility makes this unpredictable.

--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