Reading the last few messages what came to mind was 'yield to'. In the
coroutine contexts it might be more appropriate thinking of yielding
execution 'to' the other generator. But in other contexts it seems more
appropriate to think of yielding values 'from' the other generator. Of
course it does both of these things. And 'yield from' makes more sense to
me.
It reminds me of a Honeymooners skit with Ralph and Ed arguing about the
doors between two rooms labeled 'in' and 'out'.
Ralph: "You are supposed to go in the door marked 'In.'"
Ed: "I wasn't going in that room. I was coming out of this room."
Ralph: "You were not going out of this room. You were going in that
room."
Ed: "How could I go into that room without coming out of this room?"
--- Bruce
On Tue, Feb 17, 2009 at 1:04 AM, Greg Ewing
Guillaume Chereau wrote:
In the context of a coroutine, 'yield from' means : "we start this
other coroutine, and return to the current coroutine when it is done", and I was expecting the syntax to somehow express this idea.
For what it's worth, I tend to feel the same way. I was originally going to call it 'call':
y = call g(x)
but Guido convinced me that 'call' is far too generic a word and doesn't convey any connection with generators at all.
If anyone has any other suggestions, I'll gladly consider them.
-- Greg
_______________________________________________ Python-ideas mailing list Python-ideas@python.org http://mail.python.org/mailman/listinfo/python-ideas