is_true¶
-
privex.helpers.common.is_true(v) → bool[source]¶ Check if a given bool/str/int value is some form of
True:bool:
Truestr:
'true','yes','y','1'int:
1
(note: strings are automatically .lower()’d)
Usage:
>>> is_true('true') True >>> is_true('no') False
- Parameters
v (Any) – The value to check for truthfulness
- Return bool is_true
Trueif the value appears to be truthy, otherwiseFalse.