Strings
str_to_bool(val)
¶
Convert a string representation of truth to True
or False
.
True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values are 'n', 'no', 'f', 'false', 'off', and '0'.
Raises ValueError if 'val' is anything else.
Similar to the old distutils.util.strtobool
.
Source code in nava/platform/util/strings.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|