[issue45625] Add support for top-level await

2021-11-02 Thread Fred
Fred added the comment: Yeah, those other languages such as C# and JavaScript and others make async much more easier, approachable, reduces boilerplate code and lowers the bar for entry! -- ___ Python tracker

[issue45625] Add support for top-level await

2021-11-02 Thread Andrew Svetlov
Andrew Svetlov added the comment: As people write above, Python supports multiple async frameworks, asyncio is not the single choice. You should select and maybe configure the async framework before executing your first `await` statement. That's why the proposal doesn't work in Python.

[issue45625] Add support for top-level await

2021-11-02 Thread Fred
Fred added the comment: I don't care what async framework is used, nor do I care if its a x86 or ARM, or if its Windows or Linux. I don't want to have to setup an async runner because it is boilerplate code, and it brings concern into my application which is outside of the domain of my

[issue45625] Add support for top-level await

2021-11-01 Thread Terry J. Reedy
Terry J. Reedy added the comment: Python has async frameworks other than anyncio. At least one is much older than asyncio. I think that this proposal to run one by default, on startup, should be rejected. >My script must be able to run properly without any special setup. Then write it

[issue45625] Add support for top-level await

2021-11-01 Thread Fred
Fred added the comment: $ python3 --async myscript.py unknown option --async Also I cannot go around telling other people how to run my script. My script must be able to run properly without any special setup. -- ___ Python tracker

[issue45625] Add support for top-level await

2021-11-01 Thread Grégory Starck
Grégory Starck added the comment: python --async myscript.py ? -- nosy: +gstarck ___ Python tracker ___ ___ Python-bugs-list

[issue45625] Add support for top-level await

2021-11-01 Thread Éric Araujo
Éric Araujo added the comment: But Python doesn’t have a concept of main function. Anyway, it’s no use arguing here, please go to python-ideas for a wider audience. -- ___ Python tracker

[issue45625] Add support for top-level await

2021-11-01 Thread Fred
Fred added the comment: I think it would fit with the design and commmunity of Python. I think people who use Python don't care about what async runtime it is, or how to configure it or set it up, they just want to call async functions. This is 2021, we live in a async-first world. I think

[issue45625] Add support for top-level await

2021-10-31 Thread Éric Araujo
Éric Araujo added the comment: I don’t think that’s possible; it wouldn’t fit with the design of python to have an implicit async loop like that. But I’m no expert here, so you could bring this idea to https://discuss.python.org/c/ideas/6 to see what people think. --

[issue45625] Add support for top-level await

2021-10-30 Thread Fred
Fred added the comment: No, I was not aware of that. After I started Python by running "python3 -m asyncio" then it behaved as I expected it should behave by default. But this seems to work only in the REPL. I would like to write Python scripts stored in files where I can easily await at

[issue45625] Add support for top-level await

2021-10-30 Thread Éric Araujo
Éric Araujo added the comment: Do you know about using "python -m asyncio" instead of "python"? -- nosy: +eric.araujo ___ Python tracker ___

[issue45625] Add support for top-level await

2021-10-27 Thread Fred
New submission from Fred : I want top-level await without any boilerplate code or setup. Just write a "await" statement on line 1 without any indention. #!/usr/bin/env python3 import asyncio await asyncio.sleep(1) I don't want to have to call asyncio.run(main()), and I don't