Exemple #1
0
 def visit_AsyncFor(self, n: ast35.AsyncFor) -> ForStmt:
     r = ForStmt(self.visit(n.target),
                 self.visit(n.iter),
                 self.as_block(n.body, n.lineno),
                 self.as_block(n.orelse, n.lineno))
     r.is_async = True
     return r
Exemple #2
0
 def visit_AsyncFor(self, n: ast35.AsyncFor) -> Node:
     r = ForStmt(self.visit(n.target),
                 self.visit(n.iter),
                 self.as_block(n.body, n.lineno),
                 self.as_block(n.orelse, n.lineno))
     r.is_async = True
     return r
Exemple #3
0
 def visit_for_stmt(self, node: ForStmt) -> ForStmt:
     new = ForStmt(self.expr(node.index), self.expr(node.expr),
                   self.block(node.body),
                   self.optional_block(node.else_body),
                   self.optional_type(node.unanalyzed_index_type))
     new.is_async = node.is_async
     new.index_type = self.optional_type(node.index_type)
     return new
Exemple #4
0
 def visit_AsyncFor(self, n: ast3.AsyncFor) -> ForStmt:
     if n.type_comment is not None:
         target_type = parse_type_comment(n.type_comment, n.lineno,
                                          self.errors)
     else:
         target_type = None
     r = ForStmt(self.visit(n.target), self.visit(n.iter),
                 self.as_block(n.body, n.lineno),
                 self.as_block(n.orelse, n.lineno), target_type)
     r.is_async = True
     return r
Exemple #5
0
 def visit_AsyncFor(self, n: ast3.AsyncFor) -> ForStmt:
     if n.type_comment is not None:
         target_type = parse_type_comment(n.type_comment, n.lineno, self.errors)
     else:
         target_type = None
     r = ForStmt(self.visit(n.target),
                 self.visit(n.iter),
                 self.as_required_block(n.body, n.lineno),
                 self.as_block(n.orelse, n.lineno),
                 target_type)
     r.is_async = True
     return r