Re:A crash course in Python “comprehensions” and “generators”
by tomn on Saturday December 10, 2022 @08:30AM
(#33932440)
Back in the days before async/await, twisted (an asynchronous I/O framework) used these to emulate async/await -- you could yield a differed value (like a promise/future), and it would pass it back when the value was available, saving some effort making your state explicit and writing many callbacks:
https://twisted.org/documents/21.2.0/api/twisted.internet.de...