I went to the SF Python meetup when Guido talked about Tulip, the future asyncIO library for asynchronous operations in Python.
The take away is that if you want something to be run asynchronously you can use the "yield from" + expression
and a couple of decorators to specify that the call to what comes after yield from
should be executed asynchronously. The nice thing about it is that you can read the statements in that function normally (as if it was synchronous) and it will behave as if it was synchronous with respect to the execution of that function (return values and error/exception propagation and handling).
My question is: why not have the opposite behavior, namely, have all function calls be by default async (and without the yield from
) and have a different explicit syntax when you want to execute something synchronously?
(besides the need for another keyword/syntax spec)