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
def visit_arg(self, node: ast.arg) -> Optional[ast.AST]: if node.annotation is not None: node.annotation = None return node
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 visit_single_arg(self, arg: ast.arg) -> ast.arg: arg.annotation = None return arg
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