We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c5301b2 commit 0cf4e19Copy full SHA for 0cf4e19
src/unparser.rs
@@ -1142,7 +1142,9 @@ impl Unparser {
1142
self.write_str(&node.attr);
1143
}
1144
fn unparse_expr_subscript(&mut self, node: &ExprSubscript<TextRange>) {
1145
- self.unparse_expr(&node.value);
+ self.with_precedence(Precedence::Atom, |prec_self| {
1146
+ prec_self.unparse_expr(&node.value);
1147
+ });
1148
self.write_str("[");
1149
self.unparse_expr(&node.slice);
1150
self.write_str("]");
test_files/precedence.py
@@ -0,0 +1,2 @@
1
+reduce = "abcdefhijklmnopqrstuvwxyz"
2
+reduce_list = (list(reduce) + [None] * 5)[:5]
0 commit comments