Skip to content
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

Infinity numbers in constant tuples #166

Open
isidentical opened this issue Dec 9, 2019 · 0 comments
Open

Infinity numbers in constant tuples #166

isidentical opened this issue Dec 9, 2019 · 0 comments

Comments

@isidentical
Copy link
Contributor

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

@isidentical isidentical changed the title Infinity numbers in constant AST literal Infinity numbers in constant tuples Dec 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant