Skip to content

bool

const bool: (x: unknown) => boolean = builtins.bool

Defined in: packages/pythonlib/src/index.ts:183

Convert a value to a boolean using Python’s truthiness rules.

False values: null, undefined, false, 0, empty strings, empty arrays, empty Maps/Sets.

Parameters

ParameterTypeDescription
xunknownThe value to convert

Returns

boolean

The boolean value

See

Python bool()