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.