[Python-ideas] "yield from" -> "yield as"?
Carl Johnson
cmjohnson.mailinglist at gmail.com
Sat May 2 23:47:35 CEST 2009
John Graham wrote:
> There are some alternative designs for this problems that have been
> proposed. SJBrown has proposed a similar syntax, using the two
> keywords 'continue as' instead of simply 'continue'. This would
> further make clear to users unfamiliar with continuations that
> behavior is expected to be different here, and the English still flows
> elegantly. It does, however, reuse the 'as' keyword in an unfamiliar
> way.
I'm not sure what I think about redefining the continue keyword, but
has anyone already proposed doing "yield as" instead of "yield from"?
To me it make that wording makes a little more sense, "OK, you're not
yielding as f anymore, now you've silently replaced yourself with g
and it's 'as if' g is doing the yielding." "Yield from" makes it clear
that all of the values of g will be yielded, but "yield as" makes it
clear that things like .send(), etc. will be sent to g and not
intercepted by f in any real way.
My 2-cents on the bikeshed,
-- Carl
More information about the Python-ideas
mailing list