10000 Incorrect interpretation of list, tuples, and dictionaries literals · Issue #30 · pyos/dg · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Incorrect interpretation of list, tuples, and dictionaries literals #30

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

Open
jmi2k opened this issue Dec 13, 2016 · 3 comments
Open

Incorrect interpretation of list, tuples, and dictionaries literals #30

jmi2k opened this issue Dec 13, 2016 · 3 comments

Comments

@jmi2k
Copy link
jmi2k commented Dec 13, 2016

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.

@shizhaojingszj
Copy link

STRENGTH = dict' # Per-operator overrides.

Maybe this is a recommend way of write dict literals.

@ceremcem
Copy link

Maybe this is a recommend way of write dict literals.

Maybe, but author must have clarified this in 2 years.

@pyos
Copy link
Owner
pyos commented Feb 24, 2019

Maybe, but author must have clarified this in 2 years.

You're awfully generous in assuming that the author is good at writing documentation...

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

4 participants
0