_______________________________________________async def test():Hi all,Just wonder what it would look like if coroutines where awaited by default, you would only have to use "noawait" when you do *not* want to await a coroutine ?return do_something()# it's awaited here by default: we get the result and not a coroutineresult1 = test()# not awaiting here because you want to do_something_elsecoroutine = noawait test()do_something_else()result2 = await coroutineThen, you could be chaining code again like this:foo_of_result = test().fooInstead of:foo_of_result = (await test()).fooThank you in advance for your repliesHave a great weekend !--∞
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-leave@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/TZAVYTSA6MSMTJWODXIINT3OWMR5LQS4/
Code of Conduct: http://python.org/psf/codeofconduct/