Update TupleParentheses usage#5810
Conversation
3342a65 to
0d34ada
Compare
PR Check ResultsBenchmarkLinuxWindows |
0d34ada to
d33384f
Compare
7b36639 to
c3e4d6b
Compare
c3e4d6b to
45f9d84
Compare
7a323ed to
ec9b23d
Compare
konstin
left a comment
There was a problem hiding this comment.
Thanks for tackling something as finicky as the tuple parentheses! We discussed this in team and we realized naming these is hard with all the black edge cases. It would be great if we could reduce this enum to as few variants as possible to reduce complexity
b0ecc10 to
89268f0
Compare
|
I'm not in love with |
7078937 to
d7b8d1d
Compare
d7b8d1d to
6e6bb89
Compare
@konstin likes the name a lot. I believe it has the same semantics as |
MichaReiser
left a comment
There was a problem hiding this comment.
This looks good to me. I've one outstanding question about what the expected behavior for lower priority (in_parentheses_only_group) split points is inside of comprehensions.
2cb21c3 to
9ed80da
Compare
9ed80da to
97710d2
Compare
1b3178e to
9e65b9a
Compare
a490515 to
4cdc684
Compare
|
Thank you. Enabling auto merge. Hopefully, this flushes through. |
Summary
Implements a potentially more re-usable naming convention for
TupleParentheses.Subscriptcase ->Preserve- "Preserve the tuple's parentheses if they are there"SkipInsideLambdacase ->Never- "Parentheses are never needed with this parent" (#5806; comment)Comprehensioncase ->Never- "Parentheses are never needed with this parent" (#5790; comment)StripInsideForLoopcase ->NeverPreserve- "Parentheses are never preserved in special cases" (I interpret "Preserve" as "not always necessary but keep them anyway")The counter to this I'd think is that there may be benefit to having node-specific differences.
Test Plan
Existing snapshots.
Questions
Where would(answered)TupleParentheses::Expr(...)be helpful in some of these cases (if at all)?Related:
Argument