Closed rickmak closed 6 years ago
The atype function should only run if the value is provided by the duser
The atype function should not accept the default value, and it should safely assume the pass in value is a string from envvar or command line.
atype
The atype function will accept the default value, making the developer need to handle type and return. resulting following code:
def get_provider_enabled(enabled): if isinstance(enabled, bool): return enabled try: return strtobool(enabled) except ValueError: return False
The isinstance check should not be required.
isinstance
The atype function should only run if the value is provided by the duser
Expected Results
The
atype
function should not accept the default value, and it should safely assume the pass in value is a string from envvar or command line.Actual Results
The
atype
function will accept the default value, making the developer need to handle type and return. resulting following code:The
isinstance
check should not be required.