Skip to content

unused-static-method-argument (ARG004)#

Derived from the flake8-unused-arguments linter.

What it does#

Checks for the presence of unused arguments in static method definitions.

Why is this bad?#

An argument that is defined but not used is likely a mistake, and should be removed to avoid confusion.

Example#

class Class:
    @staticmethod
    def foo(arg1, arg2):
        print(arg1)

Use instead:

class Class:
    @static
    def foo(arg1):
        print(arg1)