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. 

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)

-jJ
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to