astor icon indicating copy to clipboard operation
astor copied to clipboard

astor is converting hex numbers the numbers into integers

Open F1o0T opened this issue 1 year ago • 0 comments

Is there a way to tell astor to keep showing the hex values as it is without converting it to integers?

Here is an example

import ast
import astor

code_snippet = """var = 0xf"""
parsed_ast = ast.parse(code_snippet)
source_code = astor.to_source(parsed_ast)
print(source_code) # prints var = 15

F1o0T avatar Aug 14 '24 09:08 F1o0T