[Python-ideas] Yet another alternative name for yield-from

Jim Jewett jimjjewett at gmail.com
Thu Apr 2 01:21:13 CEST 2009


On 4/1/09, Nick Coghlan <ncoghlan at gmail.com> wrote:
> Greg Ewing wrote:
>> I've just thought of another possible alternative
>> name for yield-from:

>>   y = gcall f(x)

> However, you would lose the common mnemonic with yield for both turning
> the current function into a generator and indicating to the reader that
> the current frame may get suspended at a particular point.

If the "gencall" exhausts the generator f (as "yield from" normally
does), then the current frame shouldn't be suspended any more than it
would be for an ordinary function call.  If the "return value" of the
generator really is important (and the intermediate values are
discarded), then this probably is the right syntax.   (Whether that
case is worth syntax is a matter of taste, but it does seem to be a
case Greg is trying to support.)

-jJ



More information about the Python-ideas mailing list