Skip to content

unused-lambda-argument (ARG005)

Derived from the flake8-unused-arguments linter.

What it does

Checks for the presence of unused arguments in lambda expression 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

my_list = [1, 2, 3, 4, 5]
squares = map(lambda x, y: x**2, my_list)

Use instead:

my_list = [1, 2, 3, 4, 5]
squares = map(lambda x: x**2, my_list)