4 ms·
This was already the case with generators wasn't it? Worse in that case it depend on the yield statement, which cannot be seen from the function definition. In
by contravariant 7y ago
This was already the case with generators wasn't it? Worse in that case it depend on the yield statement, which cannot be seen from the function definition.
In fact I'm pretty sure generators and async/await are almost the same feature, with possibly just some additional logic to allow await to suspend computation (so you don't have to write a loop `while not done(): sleep()` manually).
- pansa2 7y agoYes, `await` is just a modified form of `yield from`.