package pyml

  1. Overview
  2. Docs

Module Py.DictSource

Interface for Python values of type Dict.

Sourceval check : Object.t -> bool

check o returns true if o is a Python dictionary.

Sourceval clear : Object.t -> unit

Wrapper for PyDict_Clear

Sourceval copy : Object.t -> Object.t

Wrapper for PyDict_Copy

Sourceval create : unit -> Object.t

Wrapper for PyDict_New

Sourceval del_item : Object.t -> Object.t -> unit

Wrapper for PyDict_DelItem

Sourceval del_item_string : Object.t -> string -> unit
Sourceval get_item : Object.t -> Object.t -> Object.t option

Wrapper for PyDict_GetItem

find p key returns the object from Python dictionary p which has a key key. Equivalent to get_item but find raises Not_found if the key key is not present.

Sourceval find_opt : Object.t -> Object.t -> Object.t option

Alias for get_item.

Sourceval get_item_string : Object.t -> string -> Object.t option
Sourceval find_string : Object.t -> string -> Object.t

find_string p key returns the object from Python dictionary p which has a key key. Equivalent to get_item_string but find_string raises Not_found if the key key is not present.

Sourceval find_string_opt : Object.t -> string -> Object.t option

Alias for get_item_string.

Sourceval keys : Object.t -> Object.t

Wrapper for PyDict_Keys

Sourceval items : Object.t -> Object.t

Wrapper for PyDict_Items

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

Wrapper for PyDict_SetItem

Sourceval set_item_string : Object.t -> string -> Object.t -> unit
Sourceval size : Object.t -> int

Wrapper for PyDict_Size

Sourceval values : Object.t -> Object.t

Wrapper for PyDict_Str

Sourceval iter : (Object.t -> Object.t -> unit) -> Object.t -> unit

iter f dict applies f key value for each pair (key, value) in the Python dictionary dict.

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

fold f dict v returns f key1 value1 (... (f keyn valuen dict)) where (key1, value1), ..., (keyn, valuen) are the bindings of the Python dictionary dict.

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

for_all p dict checks whether all the bindings (key, value) of the Python dictionary dict satisfy the predicate p key value.

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

for_all p dict checks that there is at least one binding (key, value) among those of the Python dictionary dict that satisfies the predicate p key value.

Sourceval to_bindings : Object.t -> (Object.t * Object.t) list

to_bindings o returns all the pairs (key, value) in the Python dictionary o.

Sourceval to_bindings_map : (Object.t -> 'a) -> (Object.t -> 'b) -> Object.t -> ('a * 'b) list

to_bindings_map fkey fvalue o returns all the pairs (fkey key, fvalue value) in the Python dictionary o.

Sourceval to_bindings_string : Object.t -> (string * Object.t) list

to_bindings_string o returns all the pairs (key, value) in the Python dictionary o.

Sourceval of_bindings : (Object.t * Object.t) list -> Object.t

of_bindings b returns then Python dictionary mapping all the pairs (key, value) in b.

Sourceval of_bindings_map : ('a -> Object.t) -> ('b -> Object.t) -> ('a * 'b) list -> Object.t

of_bindings_map fkey fvalue b returns then Python dictionary mapping all the pairs (fkey key, fvalue value) in b.

Sourceval of_bindings_string : (string * Object.t) list -> Object.t

of_bindings_string b returns then Python dictionary mapping all the pairs (key, value) in b.

Sourceval singleton : Object.t -> Object.t -> Object.t

singleton key value returns the one-element Python dictionary that maps key to value

Sourceval singleton_string : string -> Object.t -> Object.t

singleton key value returns the one-element Python dictionary that maps key to value

OCaml

Innovation. Community. Security.