package pyml

  1. Overview
  2. Docs

Interface for Python values of type Long.

val check : Object.t -> bool

check o returns true if o is a Python long.

val of_int64 : int64 -> Object.t

of_int i returns the Python long with the value i. Wrapper for PyLong_FromLong.

val to_int64 : Object.t -> int64

to_int o takes a Python long o as arguments and returns the corresponding 64-bit integer value. A Python exception (Py.E _) is raised if o is not a long. Wrapper for PyLong_AsLong.

val of_int : int -> Object.t

of_int i returns the Python long with the value i. We have of_int i = of_int64 (Int64.of_int i).

val to_int : Object.t -> int

to_int o takes a Python long o as arguments and returns the corresponding integer value. A Python exception (Py.E _) is raised if o is not a long. We have to_int o = Int64.to_int (to_int 64 o).

val from_string : string -> int -> Object.t * int

from_string s base parses s as a number written in base and returns (o, l) where o is the Python long which has been read, and l is the number of characters that has been parsed. Wrapper for PyLong_FromString.

val of_string : ?base:int -> string -> Object.t

of_string ?base s parses s and returns the Python long that has been read. By default, base is 0: the radix is determined based on the leading characters of s.

val to_string : Object.t -> string

Synonym for Py.Object.to_string.

OCaml

Innovation. Community. Security.