mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-02 09:52:32 +00:00
![]() ## Summary Format named expressions (walrus operator) such a `value := f()`. Unlike tuples, named expression parentheses are not part of the range even when mandatory, so mapping optional parentheses to always gives us decent formatting without implementing all [PEP 572](https://peps.python.org/pep-0572/) rules on when we need parentheses where other expressions wouldn't. We might want to revisit this decision later and implement special cases, but for now this gives us what we need. ## Test Plan black fixtures, i added some fixtures and checked django and cpython for stability. Closes #5613 |
||
---|---|---|
.. | ||
comments | ||
expression | ||
module | ||
other | ||
pattern | ||
snapshots | ||
statement | ||
builders.rs | ||
cli.rs | ||
context.rs | ||
generated.rs | ||
lib.rs | ||
main.rs | ||
options.rs | ||
prelude.rs | ||
trivia.rs |