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/2005-May/053482.html below:

[Python-Dev] Breaking off Enhanced Iterators PEP from PEP 340

[Python-Dev] Breaking off Enhanced Iterators PEP from PEP 340 [Python-Dev] Breaking off Enhanced Iterators PEP from PEP 340Guido van Rossum gvanrossum at gmail.com
Fri May 6 22:31:58 CEST 2005
> Enhanced Iterators:
> 
> ...
> > When the *initial* call to __next__() receives an argument
> > that is not None, TypeError is raised; this is likely caused
> > by some logic error.

[Jim Jewett]
> This made sense when the (Block) Iterators were Resources,
> and the first __next__() was just to trigger the setup.
> 
> It makes less sense for general iterators.
> 
> It is true that the first call in a generic for-loop couldn't
> pass a value (as it isn't continued), but I don't see anything
> wrong with explicit calls to __next__.
> 
> Example:  An agent which responds to the environment;
> the agent can execute multi-stage plans, or change its mind
> part way through.
> 
>    action = scheduler.__next__(current_sensory_input)

Good point. I'd be happy if the requirement that the first __next__()
call doesn't have an argument (or that it's None) only applies to
generators, and not to iterators in general.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-Dev mailing list

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