Skip to content

False positive no-value-for-parameter in Pylint 2.5 #3563

@selimb

Description

@selimb

Steps to reproduce

In bug.py:

"""Whatever"""
import os

def good(*parts):
    """All good"""
    return os.path.join(*parts)

def bad(*parts):
    """False positive below this line"""
    ret = os.path.join(*parts)
    return ret

Run pylint bug.py (no user config necessary).

Current behavior

In Pylint==2.5.0 (see below for detailed versions):

************* Module bug
bug.py:10:10: E1120: No value for argument 'a' in function call (no-value-for-parameter)

------------------------------------------------------------------
Your code has been rated at 1.67/10 (previous run: 1.67/10, +0.00)

With Pylint<2.5:


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

Expected behavior

good and bad are effectively the same thing, and both are bug-free. I would expect no errors from Pylint.

Also, I don't get why the argument name is inferred as a?

>>> import inspect
>>> inspect.signature(os.path.join)
<Signature (path, *paths)>

pylint --version output

For Pylint==2.5.0 (first case above):

pylint 2.5.0
astroid 2.4.0
Python 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)]

For Pylint<2.5:

pylint 2.4.4
astroid 2.3.3
Python 3.6.8 (tags/v3.6.8:3c6b436a57, Dec 23 2018, 23:31:17) [MSC v.1916 32 bit (Intel)]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions