File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -211,6 +211,7 @@ impl Unparser {
211211 }
212212 self . fill ( "def " ) ;
213213 self . write_str ( & node. name ) ;
214+
214215 if node. type_params . len ( ) > 0 {
215216 self . write_str ( "[" ) ;
216217 let mut type_params_iter = node. type_params . iter ( ) . peekable ( ) ;
@@ -407,6 +408,10 @@ impl Unparser {
407408 self . write_str ( " in " ) ;
408409 self . unparse_expr ( & node. iter ) ;
409410 self . write_str ( ":" ) ;
411+ if let Some ( type_comment) = & node. type_comment {
412+ self . write_str ( " #type: ignore" ) ;
413+ self . write_str ( type_comment) ;
414+ }
410415 self . block ( |block_self| {
411416 for value in & node. body {
412417 block_self. unparse_stmt ( value) ;
@@ -427,6 +432,10 @@ impl Unparser {
427432 self . write_str ( " in " ) ;
428433 self . unparse_expr ( & node. iter ) ;
429434 self . write_str ( ":" ) ;
435+ if let Some ( type_comment) = & node. type_comment {
436+ self . write_str ( " #type: ignore" ) ;
437+ self . write_str ( type_comment) ;
438+ }
430439 self . block ( |block_self| {
431440 for value in & node. body {
432441 block_self. unparse_stmt ( value) ;
Original file line number Diff line number Diff line change 1+ for name_3 in name_0 : # type: ignore[name-defined] # noqa: F821
2+ pass
3+
4+
5+ async def main ():
6+ async for name_3 in name_0 : # type: ignore[name-defined] # noqa: F821
7+ pass
You can’t perform that action at this time.
0 commit comments