-
-
Save ibeauregard/c48c3c9cded72fb0d4cb1bf0e161107c to your computer and use it in GitHub Desktop.
Simple value conversion in my SQLite replica application
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def converted(value): | |
for converter in (int, float, lambda x: x): | |
try: | |
return converter(value) | |
except ValueError: | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment