Re:Go Statement Considered Harmful (2018)
by Blikkentrekker on Friday March 19, 2021 @05:53AM
(#26511581)
How can this work:
Surely it would then call `myfunc` in the main thread, block until it be done, then return whatever value it returns if it return at all, and call `create_task` with that value in the event that it return?
[ Parent
| on HN ]
IIUC if `myfunc` is an async function, calling it will immediately return a coroutine object.
None of the function’s code will run until it is `await`ed. (Unlike some other languages, async-await in Python is not “synchronous to the first await”.)
Re:Go Statement Considered Harmful (2018)
by incrudible on Friday March 19, 2021 @06:09AM
(#26511677)
It is implied that myfunc returns an awaitable object, not its ultimate result.