Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Py.Capsule
SourceEmbedding of OCaml values in Python.
For a given type 'a
, create s
returns a pair { wrap; unwrap }
. wrap v
transforms the value v
of type 'a to an opaque Python object. unwrap w
transforms the opaque Python object w
previously obtained with wrap v
into the original OCaml value v
, such that unwrap (wrap v) = v
. Failure _
is raised if a wrapper has already been generated for a type of the same name.
Same as create
, but returns a plain pair instead of a record.
type_of w
returns the type string associated to the opaque Python object w
.
Wrapper for PyCapsule_IsValid. OCaml capsules have the name "ocaml-capsule"
. We have check v = is_valid v "ocaml-capsule"
.
unsafe_wrap_value v
transforms the value v
to an opaque Python object.