Trio randomizes the order of execution using the random module to avoid user assumptions about the scheduling strategy. This is described in python-trio/trio#32 and it has a place in the code. One benefit is that if new scheduling strategies are added, the existing code will not be broken.
In contrast, asyncio has a deterministic execution order. It uses collections.deque
to manage a list of callbacks (resuming a task is a callback) and handles them in FIFO order. Callbacks scheduled for later execution are stored in a priority queue via the heapq module and added to the same deque when they are ready.
Note that asyncio guarantees the observed order of execution, but Trio does not.