-
Notifications
You must be signed in to change notification settings - Fork 37
Use async for
instead of for await
#24
Comments
#11 already has some discussions about this. |
Right, that's exactly why it should be await, instead of async. Maybe the semantics are different in Python, but in JS, |
I agree with @domenic 100% here. When I see Also, it would be really confusing if we had some |
But what about consistency and not creating yet another standard? Python was somehow inspired by ECMAScript. So why can't we use their experience since they succeed in pushing async/await into language? |
@alexeyraspopov Thanks for jumping in here, and I definitely looked at Python's syntax when we discussed this.
I agree with this, which is why we went with The motivation for using
Agreement across languages is a good thing, certainly. I wasn't able to find a syntax across languages that was consistent however. Dart, for instance, proposes |
Yes, this is what I was fumbling to say. |
guessing this can be closed? |
Yes |
Python's PEP-0492 (Coroutines with async and await syntax) has good explanation of why it should be
instead of
await
means "wait next expression to be resolved" that conflicts with meaning of cycles.async
means "next block has asynchronous computations that should be awaitable".It also will be consistent with
async function
and will request the same approach for making blocks async: simply by adding word async at the start.The text was updated successfully, but these errors were encountered: