On Thu, Apr 30, 2015 at 3:32 PM, Guido van Rossum <guido at python.org> wrote: (me:) >> A badly worded attempt to say >> Normal generator: yield (as opposed to return) means >> that the function isn't done, and there may be more >> things to return later. >> but an asynchronous (PEP492) coroutine is primarily saying: >> "This might take a while, go ahead and do something else >> meanwhile." (Yuri:) Correct. (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? If this is really just about avoiding busy-wait on network IO, then coroutine is way too broad a term, and I'm uncomfortable restricting a new keyword (async or await) to what is essentially a Domain Specific Language. -jJ
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