3 ms·
> It helps with making some specific kind of concurrency easy to reason about, because the context switch is explicit Assuming you're disagreeing with this, y
by dehrmann 5y ago
> It helps with making some specific kind of concurrency easy to reason about, because the context switch is explicit
Assuming you're disagreeing with this, yeah, I've seeing "easier concurrency" be a massive footgun because you have code that's safe as long as an await doesn't get added in the wrong place.
- BiteCode_dev 5y agoI am not, I've been using the wrong working. I would say it's pretty hard to add an await in the wrong place, although not impossible. I think it's easier to: - forget an await - forget a asyncio.wait or a asyncio.gather The later is very common, and is being addressed by the structured concurrency movement we've seen with Trio and the likes. This should end up in mainline python eventually because it is, indeed, a problem. However, it's still way easier to shot yourself in the foot with concurrency and threads than with asyncio. However, it is harder to startup with asyncio than with threads, because there is more to learn just to boot.
- dehrmann 5y ago> forget an await Do you use a typechecker?
- BiteCode_dev 5y agoAlways. But not using an await is not a type error. It's perfectly valid to not call await. There are valid reasons to do it.