Implement  a helper class for callback wrapping in python