Skip to content

Instantly share code, notes, and snippets.

@ibeauregard
Created June 10, 2021 22:59
Show Gist options
  • Save ibeauregard/c48c3c9cded72fb0d4cb1bf0e161107c to your computer and use it in GitHub Desktop.
Save ibeauregard/c48c3c9cded72fb0d4cb1bf0e161107c to your computer and use it in GitHub Desktop.
Simple value conversion in my SQLite replica application
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