Stateful Callbacks in Python
If you're unfamiliar with what a callback is, don't worry, we can sort that out quickly. If callbacks are old hat for you you might want to skip to the interesting bit.
Simply put, a callback is a function that is passed as an argument to another function which may execute it.