3 ms·
Would that work for you ? result = asyncio.run(red(x)) That's calling async function red from non-async code. Not seeing any particular readability issue
by 1337shadow 6y ago
Would that work for you ?
result = asyncio.run(red(x))
That's calling async function red from non-async code.
Not seeing any particular readability issue with that usage neither. If you don't call asyncio.run or await on the result of an async function call, then you get a coroutine for result.
- WoodenChair 6y ago> result = asyncio.run(red(x)) Still much harder to think about/read then result = red(x) We should be finding ways to get to the latter with concurrency. async/await is at best a patchwork compromise until we can do better.
- joshuamorton 6y agoI much prefer the performance implications of my code be explicit than implicit. Async in this case has less ceremony than threads. But still enough to make thing explicit.