python: Implement data callbacks.