>>> import ast
>>> ast.literal_eval('1+2')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "Python-3.7.0b5/lib/python3.7/ast.py", line 91, in literal_eval
return _convert(node_or_string)
File "Python-3.7.0b5/lib/python3.7/ast.py", line 90, in _convert
return _convert_signed_num(node)
File "Python-3.7.0b5/lib/python3.7/ast.py", line 63, in _convert_signed_num
return _convert_num(node)
File "Python-3.7.0b5/lib/python3.7/ast.py", line 55, in _convert_num