Open isidentical opened 4 years ago
Infinity numbers doesn't get handled in constant tuples, I'll prepare a patch tomorrow.
>>> my_constant = ast.Constant(value=(1, 2, 1e10000, "foo"), kind=None) >>> astor.to_source(my_constant) "(1, 2, inf, 'foo')\n"
Also i am curious about if it is OK to determine inf replacement by checking the largest value (in ast.unparse, it is handled like this: "1e" + repr(sys.float_info.max_10_exp + 1)) instead of hard coding 1e1000
"1e" + repr(sys.float_info.max_10_exp + 1)
1e1000
Infinity numbers doesn't get handled in constant tuples, I'll prepare a patch tomorrow.
Also i am curious about if it is OK to determine inf replacement by checking the largest value (in ast.unparse, it is handled like this:
"1e" + repr(sys.float_info.max_10_exp + 1)
) instead of hard coding1e1000