package pyml

  1. Overview
  2. Docs

Interface for Python values of type Bool.

val t : Object.t

The Python value True. This value is guaranteed to be the unique value associated to True.

val is_true : Object.t -> bool

Py.is_true v is true if and only if v is True. Since Py.Bool.t is guaranteed to be the unique value associated to True, Py.is_true v is equivalent to v == Py.t.

val f : Object.t

The Python value False. This value is guaranteed to be the unique value associated to False.

val is_false : Object.t -> bool

Py.is_false v is true if and only if v is False. Since Py.Bool.f is guaranteed to be the unique value associated to False, Py.is_false f is equivalent to v == Py.f.

val check : Object.t -> bool

check v returns true if v = t or v = f.

val of_bool : bool -> Object.t

of_bool b returns t if b = true, and f if b = false.

val to_bool : Object.t -> bool

to_bool b returns true if b = t, and false if b = f. Failure is raised if b is neither t nor f.

OCaml

Innovation. Community. Security.