Evaluate a single Python expression, in a way analogous to the Python
eval() built-in function.
Caveats
py_eval() only supports evaluation of 'simple' Python expressions.
Other expressions (e.g. assignments) will fail; e.g.
> py_eval("x = 1")
Error in py_eval_impl(code, convert) :
SyntaxError: invalid syntax (reticulate_eval, line 1)and this mirrors what one would see in a regular Python interpreter:
>>> eval("x = 1")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 1
x = 1
^
SyntaxError: invalid syntaxThe py_run_string() method can be used if the evaluation of arbitrary
Python code is required.