Closed clach04 closed 1 year ago
https://github.com/McCloudS/subgen/blob/fe3d26d910629d9bf5fc1184900ef21115563e4a/subgen/subgen.py#L19
def force_bool_optimistic(in_bool): """Force string value into a Python boolean value Everything is True with the exception of; false, off, and 0""" value = str(in_bool).lower() if value in ('false', 'off', '0'): return False else: return True
Thanks. That should be a little more user-proof. Just implemented it into my already poorly named "converttobool".
https://github.com/McCloudS/subgen/blob/fe3d26d910629d9bf5fc1184900ef21115563e4a/subgen/subgen.py#L19