Python: support for getting callbacks