Skip to content

LGTM.com - false positive - incorrect-overridden-signature and decorators #2041

Open
@ader1990

Description

@ader1990

Python decorators usage are shown as error

This is the error I get when I decorate a method from a subclass with a retry decorator:

Overridden method signature does not match call, where it is passed too few arguments. Overriding method function retry_decorator.wrapper.inner matches the call.

I believe that decorating a subclass method redefinition is not a break of the Liskov principle, it is just adding another layer of retries. The interface of the method does not change, just the behaviour changes, thus not breaking any principle of an overriden method.

The exact error code:
https://lgtm.com/projects/g/cloudbase/cloudbase-init/snapshot/6e7343201eaa9412e5a70065667b4390242646f3/files/cloudbaseinit/osutils/base.py?sort=name&dir=ASC&mode=heatmap#xa35fdb3e06a26f57:1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions