Python Forum
Why does await only work in async?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why does await only work in async?
#1
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Async API request and NTLM authentication himanshuj89 0 1,331 Nov-05-2022, 02:06 PM
Last Post: himanshuj89
  Transcrypt Python to JavaScript compiler now supports async/await jacques_de_hooge 4 4,631 Aug-24-2017, 04:21 PM
Last Post: snippsat
  Exploring async/await, without knowing how they work ahead of time nilamo 3 11,353 May-07-2017, 03:18 AM
Last Post: Larz60+
  PEP 492 - Coroutines [async/await] nilamo 4 6,203 Oct-05-2016, 06:05 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020