As we discussed in Chapter 10, Creating Automated Tests with unittest, many tasks in Tkinter, such as drawing and updating widgets, are done asynchronously, rather than taking immediate action when called in code. More specifically, the actions you perform in Tkinter—clicking a button, triggering a key bind or trace, resizing a window—place an event in the event queue. On each iteration of the main loop, Tkinter pulls one event from the queue and executes it.
Tasks in the event queue are roughly prioritized as regular or do-when-idle (often just called idle tasks), meaning they are to be run when every regular task in the queue has been done. Most drawing or widget-updating tasks are idle tasks, while actions like callbacks are, by default, regular priority.
Because of this, a callback task that blocks for an extended period of time...