dg
dg copied to clipboard
Incorrect interpretation of list, tuples, and dictionaries literals
I write this:
a_list = [
1,
2
]
a_tuple = (
1,
2
)
a_dict = {
("a", 1),
("b", 2)
}
print a_list
print a_tuple
print a_dict
I expect this to evaluate to:
[1, 2]
(1, 2)
{'a': 1, 'b': 2}
But instead, only the last element is seen, and I get:
[2]
2
{'b': 2}
This bug can get very annoying if you want to nicely indent them, as you are forced to put them all in the same line.
https://github.com/pyos/dg/blob/55b06a535d62900c2db239da8171b6a82eb6cb60/core/2.ast.dg#L18 Maybe this is a recommend way of write dict literals.
Maybe this is a recommend way of write dict literals.
Maybe, but author must have clarified this in 2 years.
Maybe, but author must have clarified this in 2 years.
You're awfully generous in assuming that the author is good at writing documentation...