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

unnecessary_direct_lambda_call.py:5:9: PLC3002 Lambda expression called directly. Execute the expression inline instead.
  |
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
  |

unnecessary_direct_lambda_call.py:5:30: PLC3002 Lambda expression called directly. Execute the expression inline instead.
  |
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
  |
