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

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

Open
ader1990 opened this issue Sep 27, 2019 · 0 comments
Open

Comments

@ader1990
Copy link

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

@tausbn tausbn assigned tausbn and unassigned taus-semmle Nov 13, 2019
@tausbn tausbn changed the title LGTM.com - false positive LGTM.com - false positive - incorrect-overridden-signature and decorators Nov 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants