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 for `arguments-differ` when collecting all arguments #1553

Open
benf-wspdigital opened this Issue Jun 23, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@benf-wspdigital

benf-wspdigital commented Jun 23, 2017

The arguments-differ check will complain about this common pattern:

class Ipsum:
    def dolor(self, elit):
        pass


class LoremIpsum(Ipsum):
    def dolor(self, *args, **kwargs):
        super().dolor(*args, **kwargs)

PyLint reports:

$ python3 -m pylint --reports=n --enable=arguments-differ lorem.py 
************* Module lorem
lorem.py:7: [W0235(useless-super-delegation), LoremIpsum.dolor] Useless super delegation in method 'dolor'
lorem.py:7: [W0221(arguments-differ), LoremIpsum.dolor] Parameters differ from overridden 'dolor' method

That code should not trigger the arguments-differ check, because that pattern is explicitly just passing through the arguments to the superclass's method.

@AWhetter

This comment has been minimized.

Contributor

AWhetter commented Jul 8, 2017

To any beginner contributors looking to fix this: arguments-differ is raised around

if _different_parameters(

This will likely need a fix in _different_parameters() or _has_different_parameters() where we should add a check for *args, and **kwargs in overridden.

@kczapla

This comment has been minimized.

Contributor

kczapla commented Sep 23, 2017

Hi,
I made simple fix here #1674.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment