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

unexpected-keyword-arg (E1123) and missing-kwoa (E1125) false positives with changing dict #9421

Open
RuRo opened this issue Feb 8, 2024 · 0 comments
Labels
False Positive 🦟 A message is emitted but nothing is wrong with the code Needs investigation 🔬 A bug or crash where it's not immediately obvious what is happenning

Comments

@RuRo
Copy link
Contributor

RuRo commented Feb 8, 2024

Bug description

# pylint: disable=missing-docstring


def target(*, right):
    del right


data = {"wrong": ...}

data.update({"right": ...})
# OR
# data["right"] = ...
# OR
# data.setdefault("right", ...)

data.pop("wrong")
# OR
# data.pop("wrong", None)
# OR
# del data["wrong"]

target(**data)

Command used

pylint example.py

Pylint output

************* Module example
example.py:22:0: E1123: Unexpected keyword argument 'wrong' in function call (unexpected-keyword-arg)
example.py:22:0: E1125: Missing mandatory keyword argument 'right' in function call (missing-kwoa)

Expected behavior

No errors.

Pylint version

pylint 3.0.3
astroid 3.0.3
Python 3.11.7 (main, Dec  4 2023, 18:10:11) [GCC 13.2.0]
@RuRo RuRo added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Feb 8, 2024
@RuRo RuRo changed the title unexpected-keyword-arg (E1123) false positive with changing dict unexpected-keyword-arg (E1123) and missing-kwoa (E1125) false positives with changing dict Feb 8, 2024
@Pierre-Sassoulas Pierre-Sassoulas added Needs investigation 🔬 A bug or crash where it's not immediately obvious what is happenning False Positive 🦟 A message is emitted but nothing is wrong with the code and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Feb 26, 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 investigation 🔬 A bug or crash where it's not immediately obvious what is happenning
Projects
None yet
Development

No branches or pull requests

2 participants