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

unsupported-assignment-operation false positive #10050

Open
nikita-leontiev opened this issue Oct 28, 2024 · 0 comments
Open

unsupported-assignment-operation false positive #10050

nikita-leontiev opened this issue Oct 28, 2024 · 0 comments
Labels
False Positive 🦟 A message is emitted but nothing is wrong with the code Needs PR This issue is accepted, sufficiently specified and now needs an implementation

Comments

@nikita-leontiev
Copy link

nikita-leontiev commented Oct 28, 2024

Bug description

Below code leads to unsupported-assignment-operation false positive:

if __name__ == "__main__":
    test_dict = {"key": None}
    test_dict["key"] = {"key": None}
    test_dict["key"]["key"] = 0

Command used

pylint -sn --disable=C0114 test.py

Pylint output

test.py:4:4: E1137: "test_dict['key']" does not support item assignment (unsupported-assignment-operation)

Expected behavior

No E1137.

Pylint version

pylint 3.3.1
astroid 3.3.5
Python 3.12.3 (main, Sep 11 2024, 14:17:37) [GCC 13.2.0]
@nikita-leontiev nikita-leontiev added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Oct 28, 2024
@Pierre-Sassoulas Pierre-Sassoulas added False Positive 🦟 A message is emitted but nothing is wrong with the code Needs PR This issue is accepted, sufficiently specified and now needs an implementation and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
False Positive 🦟 A message is emitted but nothing is wrong with the code 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.

2 participants