package pyml

  1. Overview
  2. Docs

Module Py.BoolSource

Interface for Python values of type Bool.

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

Sourceval 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.

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

Sourceval 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.

Sourceval check : Object.t -> bool

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

Sourceval of_bool : bool -> Object.t

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

Sourceval 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.