Py.CapsuleEmbedding of OCaml values in Python.
val check : Object.t -> boolcheck v returns true if v contains an OCaml value.
val create : string -> 'a tFor 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.
val type_of : Object.t -> stringtype_of w returns the type string associated to the opaque Python object w.
val is_valid : Object.t -> string -> boolWrapper for PyCapsule_IsValid. OCaml capsules have the name "ocaml-capsule". We have check v = is_valid v "ocaml-capsule".
val unsafe_wrap_value : 'a -> Object.tunsafe_wrap_value v transforms the value v to an opaque Python object.
val unsafe_unwrap_value : Object.t -> 'aunsafe_unwrap_value v transforms the opaque Python object w previously obtained with unsafe_wrap_value v into the original OCaml value v.