The from_formatted_string_visitor.py module#

Summary#

FromFormattedStringVisitor

Converts a string formatted for a locale to the IVariableValue variable

strtobool

Convert a string representation of truth to true (1) or false (0).

Description#

Defines the FromFormattedStringVisitor class.

Module detail#

from_formatted_string_visitor.strtobool(val)#

Convert a string representation of truth to true (1) or false (0).

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.