.. _unnecessary-direct-lambda-call:

unnecessary-direct-lambda-call / C3002
======================================

**Message emitted:**

Lambda expression called directly. Execute the expression inline instead.

**Description:**

*Used when a lambda expression is directly called rather than executing its contents inline.*

**Problematic code:**

.. literalinclude:: /data/messages/u/unnecessary-direct-lambda-call/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/u/unnecessary-direct-lambda-call/good.py
   :language: python



Created by the `lambda-expressions <https://github.com/PyCQA/pylint/blob/main/pylint/checkers/lambda_expressions.py>`__ checker.