Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Py.CallableSourceInterface for Python values of type Callable.
check v returns true if v is callable. Wrapper for PyCallable_Check.
val of_function_as_tuple :
?name:string ->
?docstring:string ->
(Object.t -> Object.t) ->
Object.tof_function_as_tuple f returns a Python callable object that calls the function f. Arguments are passed as a tuple. If f raises a Python exception (Py.E (errtype, errvalue) or Py.Err (errtype, msg)), this exception is raised as a Python exception (via Err.set_object or Err.set_error respectively). If f raises any other exception, this exception bypasses the Python interpreter.
val of_function_as_tuple_and_dict :
?name:string ->
?docstring:string ->
(Object.t -> Object.t -> Object.t) ->
Object.tof_function_as_tuple_and_dict f returns a Python callable object that calls the function f. Arguments are passed as a tuple and a dictionary of keywords.
val of_function :
?name:string ->
?docstring:string ->
(Object.t array -> Object.t) ->
Object.tEquivalent to of_function_as_tuple but with an array of Python objects instead of a tuple for passing arguments.
val of_function_with_keywords :
?name:string ->
?docstring:string ->
(Object.t array -> Object.t -> Object.t) ->
Object.tEquivalent to of_function_as_tuple_and_dict but with an array of Python objects instead of a tuple for passing arguments. The dictionary of keywords is passed as such as it is more efficient to access arguments with ``Py.Dict.find_string``, rather than using ``List.assoc`` with an associative list.
to_function_as_tuple c returns a function f such that f args calls the Python callable c with the Python tuple args as arguments.
to_function_as_tuple_and_dict c returns a function f such that f args dict calls the Python callable c with the Python tuple args and the dictionary of keywords dict as arguments.
Equivalent to to_function_as_tuple but with an array of Python objects instead of a tuple for passing arguments.