On 14/06/20 12:05 pm, Chris Angelico wrote:
On Sun, Jun 14, 2020 at 9:54 AM Greg Ewing <[email protected]> wrote:
Likewise, it's legitimate to create an awaitable
object and then await it later.
(Personally I think it *shouldn't* be legitimate to do that in
the case of await, but Guido thinks otherwise, so it is the way
it is.)
If it isn't, then how do you start multiple tasks in parallel?
There would need to be a primitive that takes an async def function
and creates an awaitable from it. The API for spawning tasks would
then take an async function and use this primitive to get things
rolling. So it wouldn't be impossible to separate the two, but you
would have to go out of your way to do it. It wouldn't be the usual
way to do things.
(For more on this, look up the discussions about my "cofunctions"
idea. It was very similar to async/await, except that the operations
of calling an async function and awaiting the result were fused into
a single syntactic entity.)
--
Greg
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/5G7RMJNRILEOVDI2IRERFJCRD2ZYH6D5/
Code of Conduct: http://python.org/psf/codeofconduct/