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

False positive E1120:no-value-for-parameter #9036

Closed
felixeriksson opened this issue Sep 13, 2023 · 1 comment · Fixed by #9038 or #9093
Closed

False positive E1120:no-value-for-parameter #9036

felixeriksson opened this issue Sep 13, 2023 · 1 comment · Fixed by #9038 or #9093
Assignees
Labels
False Positive 🦟 A message is emitted but nothing is wrong with the code
Milestone

Comments

@felixeriksson
Copy link

Bug description

class Foo:
    @staticmethod
    def func(string):
        return string

    a = func("bar")

On the last line, I get E1120: No value for argument 'string' in staticmethod call (no-value-for-parameter). I get the same error as if I remove the @staticmethod decorator, and add a first argument self to the definition of func.

Configuration

No response

Command used

pylint test.py

Pylint output

************* Module test
test.py:1:0: C0114: Missing module docstring (missing-module-docstring)
test.py:1:0: C0115: Missing class docstring (missing-class-docstring)
test.py:3:4: C0116: Missing function or method docstring (missing-function-docstring)
test.py:6:8: E1120: No value for argument 'string' in staticmethod call (no-value-for-parameter)
test.py:1:0: R0903: Too few public methods (1/2) (too-few-public-methods)

-----------------------------------
Your code has been rated at 0.00/10


### Expected behavior

I would expect the linter to not indicate that this is an error

### Pylint version

```shell
pylint 2.17.5
astroid 2.15.6
Python 3.11.0 (main, Oct 24 2022, 18:26:48) [MSC v.1933 64 bit (AMD64)]

OS / Environment

Windows PowerShell in Windows Terminal on Windows 10

Additional dependencies

No response

@felixeriksson felixeriksson added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Sep 13, 2023
@mbyrnepr2 mbyrnepr2 added 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 Sep 13, 2023
@mbyrnepr2 mbyrnepr2 self-assigned this Sep 13, 2023
mbyrnepr2 added a commit to mbyrnepr2/pylint that referenced this issue Sep 13, 2023
@mbyrnepr2 mbyrnepr2 added this to the 2.17.6 milestone Sep 13, 2023
@mbyrnepr2
Copy link
Member

Thanks for the report @felixeriksson. I'm the culprit for this one 😅

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
Projects
None yet
2 participants