pylint icon indicating copy to clipboard operation
pylint copied to clipboard

False positive for E1124 (redundant-keyword-arg)

Open bje- opened this issue 5 years ago • 5 comments

Steps to reproduce

  1. Run pylint over the following test case:
"""docstring"""

class PV1Axis():
    """Single-axis tracking PV."""
    def __init__(self, polygon, capacity, filename, column, build_limit=None, label='PV'):
        pass

class CST():
    """Concentrating solar thermal generator."""
    def __init__(self, polygon, capacity, sm, shours, filename, column, build_limit=None, label='CST'):
        pass

for g in [PV1Axis, CST]:
    if g == CST:
        for poly in range(1, 44):
            g(poly, 0, 2, 6, 0, 0, build_limit=0, label='foo')

Current behavior

example.py:16: [E1124(redundant-keyword-arg), ] Argument 'build_limit' passed by position and keyword in constructor call
example.py:16: [E1124(redundant-keyword-arg), ] Argument 'label' passed by position and keyword in constructor call

Expected behavior

I don't expect to see any warnings here.

pylint --version output

pylint 2.5.2
astroid 2.4.1
Python 3.6.9 (default, Apr 18 2020, 01:56:04) 
[GCC 8.4.0]

bje- avatar May 17 '20 09:05 bje-

Updated with a small reproducible test case.

bje- avatar May 26 '20 10:05 bje-

Still present in Pylint 2.8.3.

bje- avatar Jun 03 '21 01:06 bje-

This was fixed somewhere along the way. Works in Pylint 2.14.5.

bje- avatar Aug 13 '22 03:08 bje-

Need a check before 2.15.0 to understand if I mislabeled the issue or we regressed in the main branch.

Pierre-Sassoulas avatar Aug 13 '22 05:08 Pierre-Sassoulas

It's still an issue on main.

Pierre-Sassoulas avatar Aug 13 '22 09:08 Pierre-Sassoulas