Skip to content

Instantly share code, notes, and snippets.

@tcrayford
Created August 6, 2011 07:10
Show Gist options
  • Save tcrayford/1129119 to your computer and use it in GitHub Desktop.
Save tcrayford/1129119 to your computer and use it in GitHub Desktop.
valid = some_method_to_set_valid()
status = error_message_from_valid_flag(valid)
def error_message_from_valid_flag(valid)
if valid == 1:
return "VALIDATED"
elif valid == 0:
return "INVALID"
elif valid == -1:
return "UNINITIALIZED_ERROR"
else:
return "UNKNOWN_ERROR"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment