Skip to content

false negative with dangerous-default-value #7818

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

Closed
dpinol opened this issue Nov 22, 2022 · 1 comment · Fixed by #7856
Closed

false negative with dangerous-default-value #7818

dpinol opened this issue Nov 22, 2022 · 1 comment · Fixed by #7856
Assignees
Labels
Bug 🪲 False Negative 🦋 No message is emitted but something is wrong with the code Needs PR This issue is accepted, sufficiently specified and now needs an implementation
Milestone

Comments

@dpinol
Copy link

dpinol commented Nov 22, 2022

Bug description

# pylint: disable=missing-module-docstring
class Clazz:
    # pylint: disable=missing-docstring, too-few-public-methods
    def __init__(
        self,
        arg: str = None,
        *,
        kk: dict = {},
    ) -> None:
        pass

Configuration

No response

Command used

pylint filename.py

Pylint output

-------------------------------------------------------------------
Your code has been rated at 10.00/10 (previous run: 6.67/10, +3.33)

Expected behavior

4: W0102: Dangerous default value {} as argument (dangerous-default-value)

Pylint version

pylint 2.15.6
astroid 2.12.13
Python 3.10.8 (main, Oct 18 2022, 14:58:34) [GCC 11.2.0]

OS / Environment

ubuntu 22.4

Additional dependencies

No response

@dpinol dpinol added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Nov 22, 2022
@mbyrnepr2 mbyrnepr2 added Bug 🪲 False Negative 🦋 No message is emitted but something is wrong with the code and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Nov 22, 2022
@mbyrnepr2
Copy link
Member

Thank you @dpinol it looks like a bug. Removing the * leads to dangerous-default-argument being emitted; so something not quite right there.

@Pierre-Sassoulas Pierre-Sassoulas added the Needs PR This issue is accepted, sufficiently specified and now needs an implementation label Nov 22, 2022
@clavedeluna clavedeluna self-assigned this Nov 27, 2022
@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.16.0 milestone Nov 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🪲 False Negative 🦋 No message is emitted but something 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.

4 participants