Jan-19-2021, 09:46 AM
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
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.
Best regards
Nate
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

Why does await only work in async?
Every answer is greatly appreciated.

Best regards
Nate