mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 13:25:17 +00:00
Avoid parenthesizing unsplittable because of comments (#8431)
This commit is contained in:
parent
a08c5b7fa7
commit
dd2d8cb579
8 changed files with 781 additions and 35 deletions
|
@ -59,7 +59,10 @@ impl NeedsParentheses for AnyExpressionYield<'_> {
|
|||
OptionalParentheses::Never
|
||||
} else {
|
||||
// Ex) `x = yield f(1, 2, 3)`
|
||||
value.needs_parentheses(self.into(), context)
|
||||
match value.needs_parentheses(self.into(), context) {
|
||||
OptionalParentheses::BestFit => OptionalParentheses::Never,
|
||||
parentheses => parentheses,
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Ex) `x = yield`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue