Pycaml Documentation |
type | pyobject |
The abstract type of python objects. | |
type | pyobject_type = |
TupleType | |
| | StringType |
| | IntType |
| | FloatType |
| | ListType |
| | NoneType |
| | CallableType |
| | ModuleType |
| | ClassType |
| | TypeType |
| | OtherType |
The type representing the range of types available to python programs. Values of this type are provided by the pytype function, and identify the python type of opaque pyobject objects. |
In python API functions that take a FILE *, an int file descriptor is used instead such as those returned by the Unix library.
pytuple_toarray | pyobject -> pyobject array |
Convert a python tuple to an ocaml array containing the same items. | |
pywrap_closure | (pyobject -> pyobject) -> pyobject |
Create a python callable object from a closure. The closure receives the argument tuple from the invocation and returns a pyobject. | |
pywrap_value | 'a -> pyobject |
Create a simple void * style wrapping around an ocaml object. The object may be retrieved with pyunwrap_value : pyobject -> 'a. Use this to enclose an ocaml data structure in python to be used later. | |
pynull | unit -> pyobject |
Generate the null PyObject * and return it. This may sound dangerous, but it is used by library calls to indicate errors to the python system. | |
pynone | unit -> pyobject |
Generate a reference to the Py_None object. | |
pytuple_fromarray | pyobject array -> pyobject |
Create a pytuple (as would be used for a function call) from the given array. This may be used to implement varargs calls on python functions, and for other purposes. | |
pytuple_empty | pyobject array -> pyobject |
Shortcut for pytuple_new 0 | |
pytuple_fromsingle | pyobject -> pyobject |
Create a tuple with the single given object inside. Use this to create single element tuples as for a function call with one argument. | |
pytuple1-5 | (pyobject * ...) -> pyobject |
Create a python tuple that has the same contents as the given ocaml tuple. | |
pytype | pyobject -> pyobject_type |
Determine roughly which type family the given value belongs to. For example, pytype (pystring_fromstring "hi") yields StringType. |