Skip to content
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-negative signature-differs with kw-only args #5270

Open
cdce8p opened this issue Nov 7, 2021 · 0 comments
Open

False-negative signature-differs with kw-only args #5270

cdce8p opened this issue Nov 7, 2021 · 0 comments
Labels
C: arguments-differ Issues related to 'arguments-differ' and 'signature-differs' checks False Negative 🦋 No message is emitted but something is wrong with the code Needs PR This issue is accepted, sufficiently specified and now needs an implementation

Comments

@cdce8p
Copy link
Member

cdce8p commented Nov 7, 2021

Bug description

The following example should emit signature-differs due to different default values.

class Parent:
    def statement(self, *, future = None):
        pass

class Child(Parent):
    def statement(self, *, future):  # should emit 'signature-differs'
        pass

Removing * will yield:

W0222: Signature differs from overridden 'statement' method (signature-differs)

Configuration

No response

Command used

pylint test.py

Pylint output

-

Expected behavior

W0222: Signature differs from overridden 'statement' method (signature-differs)

Pylint version

pylint 2.11.2-dev0
astroid 2.8.5-dev0
Python 3.10.0 (v3.10.0:b494f5935c, Oct  4 2021, 14:59:20) [Clang 12.0.5 (clang-1205.0.22.11)]

OS / Environment

No response

Additional dependencies

No response

@cdce8p cdce8p added the False Negative 🦋 No message is emitted but something is wrong with the code label Nov 7, 2021
@cdce8p cdce8p added the C: arguments-differ Issues related to 'arguments-differ' and 'signature-differs' checks label Nov 17, 2021
@Pierre-Sassoulas Pierre-Sassoulas added the Needs PR This issue is accepted, sufficiently specified and now needs an implementation label Jul 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: arguments-differ Issues related to 'arguments-differ' and 'signature-differs' checks False Negative 🦋 No message is emitted but something is wrong with the code Needs PR This issue is accepted, sufficiently specified and now needs an implementation
Projects
None yet
Development

No branches or pull requests

2 participants