Domanda di colloquio di BMAT

How does the "event loop" work in python

Risposta di colloquio

Anonimo

26 gen 2024

- There isn't an "event loop" in python, It is a task queue in which tasks are added, processed in order and then new tasks are created and added, but there are a myriad of ways in which to implement it, async/await in python is agnostic of these implementation details, you just need to know they exist, and they don't get added to the task queue until you await them, or force to add them, (unlike in Node)