Skip to content
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

List should be treated as invalid unpacking targets #1256

Closed
sobolevn opened this issue Mar 16, 2020 · 2 comments · Fixed by #1259
Closed

List should be treated as invalid unpacking targets #1256

sobolevn opened this issue Mar 16, 2020 · 2 comments · Fixed by #1259
Assignees
Labels
help wanted Extra attention is needed level:starter Good for newcomers pr-available rule request Adding a new rule

Comments

@sobolevn
Copy link
Member

Rule request

Thesis

Currently, this code passes our linter:

[first, second] = some()

But, it is wrong. We need to force:

first, second = some()

So, we need to disallow ast.List as an unpacking target.

Reasoning

There's an already a working way of doing unpacking assignment: tuples.
We don't need one more way to do it.

I would say this is a consistency rule.

@sobolevn sobolevn added help wanted Extra attention is needed level:starter Good for newcomers rule request Adding a new rule labels Mar 16, 2020
@sobolevn sobolevn added this to the Version 0.15 milestone Mar 16, 2020
@skarzi
Copy link
Collaborator

skarzi commented Mar 16, 2020

Can I prepare PR for this issue?

@sobolevn
Copy link
Member Author

@skarzi sure! Thanks a lot!

@skarzi skarzi mentioned this issue Mar 16, 2020
4 tasks
@helpr helpr bot added the pr-available label Mar 16, 2020
@sobolevn sobolevn modified the milestones: Version 0.16, Version 0.15 aka New runtime Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed level:starter Good for newcomers pr-available rule request Adding a new rule
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants