PyCQA / flake8-bugbear

A plugin for Flake8 finding likely bugs and design problems in your program. Contains warnings that don't belong in pyflakes and pycodestyle.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

B026 False negative on class methods

Klim314 opened this issue · comments

Summary

B026 does not apply to class methods, only to functions

Version

Replicated on version 23.9.16

Sample code

def foo(a, b, c):
    pass
foo(a=1, b=2, c=3, *[1])  # linting error here

class Bar:
    def foo(self, a, b, c):
        pass

Bar().foo(a=1, b=2, c=3, *[1])  # no linting error

Good catch. This is likely fixable by unindenting

self.check_for_b026(node)
by one level (plus adding some tests).