News for hackers. Stuff that matters.
Re:A viable solution for Python concurrency by heavyset_go on Friday October 15, 2021 @04:16PM (#28882644)
> Why the whole even loop thing is even visible at all.

It isn't anymore.

    In [3]: from asyncio import run

    In [4]: async def async_func(): print('Ran async_func()')

    In [5]: run(async_func())
    Ran async_func()
Top-level async/await is also available in the Python REPL and IPython, and there are discussions on the Python mailing list about making top-level async/await the default for Python[1].

    In [1]: async def async_func(): print('Ran async_func()')

    In [2]: await async_func()
    Ran async_func()

[1] https://groups.google.com/g/python-ideas/c/PN1_j7Md4j0/m/0xy...
Re:A viable solution for Python concurrency by BiteCode_dev on Friday October 15, 2021 @05:15PM (#28883207)
Oh, top level await... I missed that.

Not sure it will get there, but it would be nice. I think putting a top level "await" is explicit enough for stating you want an event loop anyway.

Now, with TaskGroup in 3.11, things are going to get pretty nice, espacially if this top level await plays out, provided they include async for and async with in the mix.

Now, if they could just make so that coroutines are automatically schedules to the nearest task group, we would almost have something usable.