What's the preferred way to implement a hook or callback in Python? What's the preferred way to implement a hook or callback in Python? python python