Skip to content

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

Open
@cdce8p

Description

@cdce8p

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: arguments-differIssues related to 'arguments-differ' and 'signature-differs' checksFalse Negative 🦋No message is emitted but something is wrong with the codeNeeds PRThis issue is accepted, sufficiently specified and now needs an implementation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions