pylint-dev / pylint

It's not just a linter that annoys you!
https://pylint.readthedocs.io/en/latest/
GNU General Public License v2.0
5.34k stars 1.14k forks source link

False positive for E1124 (redundant-keyword-arg) #3633

Open bje- opened 4 years ago

bje- commented 4 years ago

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- commented 4 years ago

Updated with a small reproducible test case.

bje- commented 3 years ago

Still present in Pylint 2.8.3.

bje- commented 2 years ago

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

Pierre-Sassoulas commented 2 years ago

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

Pierre-Sassoulas commented 2 years ago

It's still an issue on main.