---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
PLC3002 Lambda expression called directly. Execute the expression inline instead.
 --> unnecessary_direct_lambda_call.py:4:5
  |
2 | # pylint: disable=undefined-variable, line-too-long
3 |
4 | y = (lambda x: x**2 + 2*x + 1)(a)  # [unnecessary-direct-lambda-call]
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5 | y = max((lambda x: x**2)(a), (lambda x: x+1)(a))  # [unnecessary-direct-lambda-call,unnecessary-direct-lambda-call]
  |

PLC3002 Lambda expression called directly. Execute the expression inline instead.
 --> unnecessary_direct_lambda_call.py:5:9
  |
4 | y = (lambda x: x**2 + 2*x + 1)(a)  # [unnecessary-direct-lambda-call]
5 | y = max((lambda x: x**2)(a), (lambda x: x+1)(a))  # [unnecessary-direct-lambda-call,unnecessary-direct-lambda-call]
  |         ^^^^^^^^^^^^^^^^^^^
  |

PLC3002 Lambda expression called directly. Execute the expression inline instead.
 --> unnecessary_direct_lambda_call.py:5:30
  |
4 | y = (lambda x: x**2 + 2*x + 1)(a)  # [unnecessary-direct-lambda-call]
5 | y = max((lambda x: x**2)(a), (lambda x: x+1)(a))  # [unnecessary-direct-lambda-call,unnecessary-direct-lambda-call]
  |                              ^^^^^^^^^^^^^^^^^^
  |
