mirror of
https://github.com/astral-sh/ruff
synced 2026-01-22 05:51:03 -05:00
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.