Python Forum

Full Version: Why does await only work in async?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everyone,

after reading a basics book on Python I started to look into more advanced topics.
Now I am trying to understand how Asynchronous Programming (Async/Await) in Python works. As far as I understand it works with an event loop where something is added to a Queue and if the previous events has been processed the next one gets processed. Know I am wondering about the Async/Await Syntax and Implementation. I know that Await only works inside of Async. But after searching for a while I still can't find an answer to the question why it is that way. If I ask the wrong question Wall please tell me what a better question would be. So to end this post here is the exact question:

Why does await only work in async?

Every answer is greatly appreciated. Smile

Best regards
Nate