Skip to content
Snippets Groups Projects
Commit 9689c204 authored by Alán Muñoz's avatar Alán Muñoz
Browse files

feat(cast): add module with casting operations

parent 91597209
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env jupyter
"""
Convert some types to others
"""
def _str_to_int(x: str or None):
"""
Cast string as int if possible. If Nonetype return None.
"""
if x:
try:
return int(x)
except:
return x
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment