unnecessary-lambda-assignment / C3001#

Message emitted:

Lambda expression assigned to a variable. Define a function using the "def" keyword instead.


Used when a lambda expression is assigned to variable rather than defining a standard function with the "def" keyword.

Correct code:

def foo(x):
    return x**2 + 2*x + 1

Problematic code:

foo = lambda x: x**2 + 2*x + 1  # [unnecessary-lambda-assignment]

Created by the lambda-expressions checker.