Closed andycui97 closed 1 year ago
actually i take that back. the fact that the test fails in py3.7 tells me that bytes behaves differently for that version. lets have a quick sync on this before merging
ok a quick check gives me this: in python 3.7:
>>> import ast
>>> from astpretty import pprint
>>> pprint(ast.parse("b'10'"))
Module(
body=[
Expr(
lineno=1,
col_offset=0,
value=Bytes(lineno=1, col_offset=0, s=b'10'),
),
],
)
>>>
and in 3.9:
>>> import ast
>>> from astpretty import pprint
>>> pprint(ast.parse("b'10'"))
Module(
body=[
Expr(
lineno=1,
col_offset=0,
end_lineno=1,
end_col_offset=5,
value=Constant(lineno=1, col_offset=0, end_lineno=1, end_col_offset=5, value=b'10', kind=None),
),
],
type_ignores=[],
)
so we need to add a visit_Bytes that is only triggered in python 3.7
Description
Add support for byte literals
Fixes LIN-655
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Added test cases for Literal Node under
tests/unit/db/test_literal_node.py
.