why not just use types.FunctionType