Files
ruff/crates/ruff_python_formatter/tests
Brent Westbrook 5c441523e3 Preserve required parentheses in lambda bodies (#22747)
Summary
--

This PR fixes the issues revealed in #22744 by adding an additional
branch to
the lambda body formatting that checks if the body `needs_parentheses`
before
falling back on the `Parentheses::Never` case. I also updated the
`ExprNamed::needs_parentheses` implementation to match the one from
#8465.

Test Plan
--

New test based on the failing cases in #22744. I also checked out #22744
and
checked that the tests pass after applying the changes from this PR.
2026-01-20 10:28:29 -05:00
..
2025-10-14 10:14:59 -04:00