Skip to content

False Negative no-value-for-parameter for instances used inside of a class #10731

@bhmarscheck

Description

@bhmarscheck

Bug description

# pylint: disable=too-few-public-methods
class FooClass:
    def foo1(self, a):
        return a

foo_global_inst = FooClass()
print(foo_global_inst.foo1())

class TestClass:
    def __init__(self, foo_inst: FooClass):
        self.foo_inst = foo_inst

    def bar1(self):
        foo_inst: FooClass = self.foo_inst
        foo_inst.foo1()

    def bar2(self):
        self.foo_inst.foo1()

    def bar3(self, foo_inst: FooClass):
        foo_inst.foo1()

Configuration

Command used

pylint test.py

Pylint output

************* Module test
test.py:7:6: E1120: No value for argument 'a' in method call (no-value-for-parameter)

Expected behavior

I would expect E1120 for all calles of foo1 or at least for the calls inside bar1 and bar3

Pylint version

pylint 4.0.2
astroid 4.0.2
Python 3.12.3 (tags/v3.12.3:f6650f9, Apr  9 2024, 14:05:25) [MSC v.1938 64 bit (AMD64)]

OS / Environment

Windows 11

Additional dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs triage 📥Just created, needs acknowledgment, triage, and proper labelling

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions