Re:Python has had async for 10 years – why isn't it more pop...
by int_19h on Tuesday September 02, 2025 @05:34PM
(#45109368)
Generators are orthogonal to all this. They are the equivalent of `function*` in JS. And yes, they are also coroutines, but experience has shown that keeping generators separate from generic async functions is more ergonomic (hence why C# and JS both do the same thing).
[ Parent
| on HN ]
Re:Python has had async for 10 years – why isn't it more pop...
by xg15 on Tuesday September 02, 2025 @05:42PM
(#45109459)
True. I think the connection is more a historical one became the first async implementation was done using generators and lots of "yield from" statements AFAIK.
But I think generators are still sometimes mentioned in tutorials for this reason.
Re:Python has had async for 10 years – why isn't it more pop...
by int_19h on Tuesday September 02, 2025 @05:53PM
(#45109604)
Implementing what was essentially an equivalent of `await` on top of `yield` (before we got `yield from` even) was a favorite pastime at some point. I worked on a project that did exactly that for WinRT projection to Python. And before that there was Twisted. It's very tempting because it gets you like 90% there. But then eventually you want something like `async for` etc...