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/2009-February/085908.html below:

[Python-Dev] Missing operator.call

[Python-Dev] Missing operator.call [Python-Dev] Missing operator.callGreg Ewing greg.ewing at canterbury.ac.nz
Fri Feb 6 09:10:10 CET 2009
Guido van Rossum wrote:

> Why is "call expr" a more enticing syntax than "yield *expr" ?

I was thinking it would read better when you're
using generators as lightweight threads, and you
want the one-level-deep nature of generators to
be hidden as much as possible.

The fact that yielding is going on is not of
interest in that situation -- it's just an
implementation detail. What you really want to
express is calling another function, but without
losing your status of coroutine-ness.

Another way of thinking about it is that it
allows you to abstract out a chunk of code from
a generator that contains a 'yield' and put it
into another function, and then call it in
a way that resembles an ordinary function call
as closely as possible.

Maybe 'call' isn't the best word for that, but
I haven't thought of anything better so far.

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