import ast
m = ast.parse(
"""
def test(
ewr,
ats):
print("123")
""")
print(m.body[0].args.args[0].col_offset)
m = ast.parse(
"""
if (ewr
and af):
print("123")
""")
print(m.body[0].test.col_offset)
"""
if (ewr and af):
print("123")
"""
print(m.body[0].test.col_offset)
In the first and second examples, the ewr
argument and the and
operator are on the same level, however, their col_offset
is different. The col_offset
of the operator also does not change in the 3rd example. Why is it calculating so?