Conversation
|
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. |
|
CLAs look good, thanks! |
|
Thanks for submitting this. |
|
I added an assertion, yes looks like negative numbers are still parsed as before to type int or float. I guess the expression must be |
fire/parser.py
Outdated
| """ | ||
| root = ast.parse(value, mode='eval') | ||
| if isinstance(root.body, ast.BinOp): | ||
| return value |
There was a problem hiding this comment.
Let's raise a ValueError here instead, so that the logic of "treat this thing that doesn't parse as a string" all exists in one place (line 74).
There was a problem hiding this comment.
Ahh right, the fallback logic is to treat it as a string anyway. Good point.
|
Thanks for adding the negative number tests in |
Fixes #95
Don't evaluate top level ast.BinOp arguments, treat them as strings instead.