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

New checker - unbalanced-dictionary-unpacking #5797

Closed
mbyrnepr2 opened this issue Feb 11, 2022 · 4 comments · Fixed by #7750
Closed

New checker - unbalanced-dictionary-unpacking #5797

mbyrnepr2 opened this issue Feb 11, 2022 · 4 comments · Fixed by #7750
Assignees
Labels
Enhancement ✨ Improvement to a component Good first issue Friendly and approachable by new contributors Hacktoberfest Help wanted 🙏 Outside help would be appreciated, good for new contributors Needs PR This issue is accepted, sufficiently specified and now needs an implementation
Milestone

Comments

@mbyrnepr2
Copy link
Member

mbyrnepr2 commented Feb 11, 2022

Bug description

Also mentioned in discussion in #5113.

The following situation does not issue a message from Pylint:
a.py:

for a, b, c, d, e, f, g in {1: 2}.items():
    pass

On the other hand, Python gives:

Traceback (most recent call last):
  File "a.py", line 1, in <module>
    for a, b, c, d, e, f, g in {1: 2}.items():
ValueError: not enough values to unpack (expected 7, got 2)

Configuration

No response

Command used

pylint a.py

Pylint output

No output

Expected behavior

Emit a message indicating the unpacking error.

Pylint version

pylint 2.13.0-dev0
astroid 2.9.3
Python 3.10.0b2 (v3.10.0b2:317314165a, May 31 2021, 10:02:22) [Clang 12.0.5 (clang-1205.0.22.9)]

OS / Environment

No response

Additional dependencies

No response

@mbyrnepr2 mbyrnepr2 added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Feb 11, 2022
@DanielNoord
Copy link
Collaborator

Is this a false negative or a new message? And if the latter, can we come up with a good name for a good message?

@DanielNoord DanielNoord added Enhancement ✨ Improvement to a component and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Feb 12, 2022
@mbyrnepr2
Copy link
Member Author

Good point @DanielNoord - I thought one of the existing unpacking checkers could cover it but perhaps not.

Perhaps unbalanced-dictionary-unpacking?

@DanielNoord
Copy link
Collaborator

Yeah that works for me!

@mbyrnepr2 mbyrnepr2 changed the title False negative - unpacking dictionary items New checker - unbalanced-dictionary-unpacking Feb 12, 2022
@Pierre-Sassoulas Pierre-Sassoulas added Help wanted 🙏 Outside help would be appreciated, good for new contributors Good first issue Friendly and approachable by new contributors Needs PR This issue is accepted, sufficiently specified and now needs an implementation labels Jul 6, 2022
@clavedeluna
Copy link
Contributor

I'll be working on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement ✨ Improvement to a component Good first issue Friendly and approachable by new contributors Hacktoberfest Help wanted 🙏 Outside help would be appreciated, good for new contributors Needs PR This issue is accepted, sufficiently specified and now needs an implementation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants