By wrapping the dict values in a tuple and iterating over it instead, a
copy of the references contained within is made, and is thus unaffected
by the underlying dictionary changing size during runtime.
Calling a thread's update method may lead to the thread modifying the
board's cache during the iteration, leading to the described
RuntimeError.
By wrapping the dict values in a tuple and iterating over it instead, a copy of the references contained within is made, and is thus unaffected by the underlying dictionary changing size during runtime.
Calling a thread's update method may lead to the thread modifying the board's cache during the iteration, leading to the described RuntimeError.