package pyml

  1. Overview
  2. Docs

Module Py.TupleSource

Interface for Python values of type Tuple.

Sourceval check : Object.t -> bool

check o returns true if o is a Python tuple.

Sourceval create : int -> Object.t

Wrapper for PyTuple_New

Sourceval empty : Object.t

The empty tuple (). This value is guaranteed to be the unique value associated to ().

Sourceval is_empty : Object.t -> bool

Py.is_empty v is true if and only if v is (). Since Py.Tuple.empty is guaranteed to be the unique value associated to (), Py.is_empty v is equivalent to v == Py.empty.

Sourceval get_item : Object.t -> int -> Object.t

Equivalent to Sequence.get_item.

Sourceval get : Object.t -> int -> Object.t

Equivalent to get_item.

Sourceval set_item : Object.t -> int -> Object.t -> unit

Wrapper for PyTuple_SetItem

Sourceval set : Object.t -> int -> Object.t -> unit

Equivalent to set_item.

Sourceval get_slice : Object.t -> int -> int -> Object.t

Wrapper for PyTuple_GetSlice

Sourceval size : Object.t -> int

Wrapper for PyTuple_Size

Sourceval init : int -> (int -> Object.t) -> Object.t

init n f returns the Python tuple (f 0, f 1, ..., f (n - 1)).

Sourceval of_array : Object.t array -> Object.t

of_array a returns the Python tuple with the same elements as a.

Sourceval of_array_map : ('a -> Object.t) -> 'a array -> Object.t

of_array_map f a returns the Python tuple (f a0, ..., f ak) where a0, ..., ak are the elements of a.

Sourceval of_list : Object.t list -> Object.t

of_list l returns the Python tuple with the same elements as l.

Sourceval of_list_map : ('a -> Object.t) -> 'a list -> Object.t

of_list f l returns the Python tuple (f l1, ..., f ln) where l1, ..., ln are the elements of l. of_list_map f l is equivalent to of_list (List.map f l) but is tail-recursive.

Sourceval to_array : Object.t -> Object.t array

Equivalent to Sequence.to_array.

Sourceval to_array_map : (Object.t -> 'a) -> Object.t -> 'a array

Equivalent to Sequence.to_array_map.

Sourceval to_list : Object.t -> Object.t list

Equivalent to Sequence.to_list.

Sourceval to_list_map : (Object.t -> 'a) -> Object.t -> 'a list

Equivalent to Sequence.to_list_map.

of_seq s returns the Python tuple with the values of the sequence s.

Sourceval to_seqi : Object.t -> (int * Object.t) Stdcompat.Seq.t

Equivalent to Sequence.to_seqi.

Sourceval fold_left : ('a -> Object.t -> 'a) -> 'a -> Object.t -> 'a

Equivalent to Sequence.fold_left.

Sourceval fold_right : (Object.t -> 'a -> 'a) -> Object.t -> 'a -> 'a

Equivalent to Sequence.fold_right.

Sourceval for_all : (Object.t -> bool) -> Object.t -> bool

Equivalent to Sequence.for_all.

Sourceval exists : (Object.t -> bool) -> Object.t -> bool

Equivalent to Sequence.exists.

Sourceval of_sequence : Object.t -> Object.t

Equivalent to Sequence.tuple.

Sourceval of_tuple1 : Object.t -> Object.t

of_tuple1 o0 returns the Python tuple (o0).

Sourceval of_tuple2 : (Object.t * Object.t) -> Object.t

of_tuple4 (o0, o1) returns the Python tuple (o0, o1).

Sourceval of_tuple3 : (Object.t * Object.t * Object.t) -> Object.t

of_tuple4 (o0, o1, o2) returns the Python tuple (o0, o1, o2).

Sourceval of_tuple4 : (Object.t * Object.t * Object.t * Object.t) -> Object.t

of_tuple4 (o0, o1, o2, o3) returns the Python tuple (o0, o1, o2, o3).

of_tuple5 (o0, o1, o2, o3, o4) returns the Python tuple (o0, o1, o2, o3, o4).

Sourceval to_tuple1 : Object.t -> Object.t

to_tuple1 t returns the value Py.Tuple.get_item t 0.

Sourceval to_tuple2 : Object.t -> Object.t * Object.t

to_tuple5 t returns the tuple (Py.Tuple.get_item t 0, Py.Tuple.get_item t 1).

Sourceval to_tuple3 : Object.t -> Object.t * Object.t * Object.t

to_tuple5 t returns the tuple (Py.Tuple.get_item t 0, Py.Tuple.get_item t 1, Py.Tuple.get_item t 2).

to_tuple5 t returns the tuple (Py.Tuple.get_item t 0, Py.Tuple.get_item t 1, Py.Tuple.get_item t 2, Py.Tuple.get_item t 3).

to_tuple5 t returns the tuple (Py.Tuple.get_item t 0, Py.Tuple.get_item t 1, Py.Tuple.get_item t 2, Py.Tuple.get_item t 3, Py.Tuple.get_item t 4).

Sourceval singleton : Object.t -> Object.t

Equivalent to of_tuple1.

Sourceval to_singleton : Object.t -> Object.t

Equivalent to to_tuple1.

Sourceval of_pair : (Object.t * Object.t) -> Object.t

Equivalent to of_tuple2.

Sourceval to_pair : Object.t -> Object.t * Object.t

Equivalent to to_tuple2.

OCaml

Innovation. Community. Security.