>>> to_bool('True')
True
+
>>> to_bool('1')
True
+
>>> to_bool('yes')
True
+
>>> to_bool('no')
False
+
>>> to_bool('huh?')
False
+
+ >>> to_bool('on')
+ True
+
"""
if not is_string(in_str):
raise ValueError(in_str)
- return in_str.lower() in ("true", "1", "yes", "y", "t")
+ return in_str.lower() in ("true", "1", "yes", "y", "t", "on")
def to_date(in_str: str) -> Optional[datetime.date]: