New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't generate code containing ast.Num(NaN) #85
Comments
We can add this if someone submits a PR, but of course, it won't round-trip AST -> Python -> AST properly, so any test for this will have to special-case this. |
@Kodiologist I'm planning to release 0.7.0 this weekend and I can merge a fix for this if you still need it for Hy. |
It would be convenient, but it's not necessary. I worked around the issue in Hy commit a074bb9a5c3 by replacing NaN with such expressions in the compiler. |
Somewhat related to #82, the
codegen
of astor 0.5 would producenan
if given aNum
node that contained NaN. In astor 0.6, the following raises anAssertionError
in code_gen.py:While Python has no NaN literal, you could represent
ast.Num(nan)
as an expression (such as1e1000 - 1e1000
) if you want to generate real Python. See hylang/hy#1447.The text was updated successfully, but these errors were encountered: