Antoine Pitrou wrote: > There seems to be a misunderstanding as to how generators > are used in Twisted. There isn't a global "trampoline" to schedule generators > around. Instead, generators are wrapped with a decorator (*) which collects each > yielded value (it's a Deferred object) and attaches to it a callback which > resumes (using send()) the execution of the generator whenever the Deferred > finally gets its value. This sounds like an architecture that was developed to work around the lack of anything like yield-from in the language. You can't expect to improve something like that by stuffing yield-from into the existing framework, because the point of yield-from is to render the framework itself unnecessary. To take full advantage of it, you need to step back and re-design the whole thing in a different way. In the case of Twisted, I expect the new design would look a lot like my generator scheduling example. -- Greg
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