Closed Kodiologist closed 6 years ago
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.