Esempio n. 1
0
 def visit_arg(self, node: ast.arg) -> ast.arg:
     """
     Arguments in definition signatures.
     """
     node.arg = self.add_placeholder(node.arg)
     if node.annotation:
         node.annotation = None
     self.generic_visit(node)
     return node
Esempio n. 2
0
 def visit_arg(self, node: ast.arg) -> ast.AST:
     node.arg = self._get_replacement_identifier(node.arg)
     return self.generic_visit(node)
Esempio n. 3
0
 def visit_arg(self, node: ast.arg) -> Optional[ast.AST]:
     if node.annotation is not None:
         node.annotation = None
     return node
Esempio n. 4
0
 def visit_single_arg(self, arg: ast.arg) -> ast.arg:
     arg.annotation = None
     return arg
Esempio n. 5
0
 def visit_arg(self, node: ast.arg) -> ast.arg:
     node = cast(ast.arg, self.generic_visit(node))
     node.annotation = self._visit_annotation(node.annotation)
     return node
 def annotate_arg(self, arg: ast.arg) -> ast.arg:
     """Add annotation to single function argument"""
     arg_name = arg.arg
     if arg_name in self.argument_types:
         arg.annotation = parse_type(self.argument_types[arg_name])
     return arg