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

[Python-Dev] next(arg) was: Anonymous blocks: Thunks or iterators?

[Python-Dev] next(arg) was: Anonymous blocks: Thunks or iterators? [Python-Dev] next(arg) was: Anonymous blocks: Thunks or iterators?Jim Jewett jimjjewett at gmail.com
Fri Apr 29 19:48:57 CEST 2005
Guido van Rossum:
> One [of many separate ideas in PEP 340] is turning generators
> into more general coroutines: continue EXPR passes the expression
> to the iterator's next() method ...

I would have been very happy with that a week ago.  Seeing the
specific implementation changed my mind.  

The caller shouldn't know what state the generator is in, so the
passed-in-message will be the same regardless of which yield 
accepts it.  Unless I have a single-yield generator, this means
I end up writing boilerplate code to accept and process the arg
at each yield.  I don't want more boilerplate.

> Even without a block-statement, these two changes make yield look a
> lot like invoking a thunk 

Though it feels backwards to me; yield is returning control to something
that already had to coordinate the thunks itself.

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