File tree 2 files changed +16
-1
lines changed
2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -1152,7 +1152,16 @@ impl Unparser {
1152
1152
self . write_str ( " in " ) ;
1153
1153
self . unparse_expr ( & node. iter ) ;
1154
1154
for if_ in & node. ifs {
1155
- self . unparse_expr ( if_) ;
1155
+ self . write_str ( " " ) ;
1156
+ match if_ {
1157
+ Expr :: Name ( name) => {
1158
+ self . write_str ( "if " ) ;
1159
+ self . write_str ( & name. id ) ;
1160
+ }
1161
+ _ => {
1162
+ self . unparse_expr ( if_) ;
1163
+ }
1164
+ }
1156
1165
}
1157
1166
}
1158
1167
Original file line number Diff line number Diff line change 5
5
set_ = {def_ for def_ in random .choices (string .ascii_letters )}
6
6
dict_ = {k : v for k , v in enumerate (random .choices (string .ascii_letters ))}
7
7
list_ = [value for value in random .choices (string .ascii_letters )]
8
+
9
+
10
+ with_outer_if = (value for value in random .choices (string .ascii_letters ) if value )
11
+ with_inner_if_else = (
12
+ value if value else "missing!" for value in random .choices (string .ascii_letters )
13
+ )
You can’t perform that action at this time.
0 commit comments