3 ms·
Python also chains methods. And having to write (await (await (await foo).bar()).baz()) is annoying.
by int_19h 8y ago
Python also chains methods. And having to write (await (await (await foo).bar()).baz()) is annoying.
- imtringued 8y agoThat doesn't look like well written async code at all... You're not supposed to use await literally everywhere and especially not multiple times in a single line. Javascript already has an answer to this (Hint it was inspired by Monads but it isn't one): await foo.then(f => f.bar()).then(b => b.baz())
- int_19h 8y agoWhat happens if f.bar() throws an exception asynchronously?