On Fri, May 1, 2015 at 2:59 PM, Guido van Rossum <gu...@python.org> wrote: > On Fri, May 1, 2015 at 11:26 AM, Jim J. Jewett <jimjjew...@gmail.com> wrote: >> >> On Thu, Apr 30, 2015 at 3:32 PM, Guido van Rossum <gu...@python.org> >> wrote: >>
>> (Guido:)> Actually that's not even wrong. When using generators as >> coroutines, PEP 342 >> > style, "yield" means "I am blocked waiting for a result that the I/O >> > multiplexer is eventually going to produce". >> So does this mean that yield should NOT be used just to yield control >> if a task isn't blocked? (e.g., if its next step is likely to be >> long, or low priority.) Or even that it wouldn't be considered a >> co-routine in the python sense? > I'm not sure what you're talking about. Does "next step" refer to something > in the current stack frame or something that you're calling? The next piece of your algorithm. > None of the > current uses of "yield" (the keyword) in Python are good for lowering > priority of something. If there are more tasks than executors, yield is a way to release your current executor and go to the back of the line. I'm pretty sure I saw several examples of that style back when coroutines were first discussed. -jJ _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com