Call expression. This can also represent several special forms that are syntactically calls such as cast(...) and None # type: ....
| 2508 | |
| 2509 | |
| 2510 | class CallExpr(Expression): |
| 2511 | """Call expression. |
| 2512 | |
| 2513 | This can also represent several special forms that are syntactically calls |
| 2514 | such as cast(...) and None # type: .... |
| 2515 | """ |
| 2516 | |
| 2517 | __slots__ = ("callee", "args", "arg_kinds", "arg_names", "analyzed") |
| 2518 | |
| 2519 | __match_args__ = ("callee", "args", "arg_kinds", "arg_names") |
| 2520 | |
| 2521 | def __init__( |
| 2522 | self, |
| 2523 | callee: Expression, |
| 2524 | args: list[Expression], |
| 2525 | arg_kinds: list[ArgKind], |
| 2526 | arg_names: list[str | None], |
| 2527 | analyzed: Expression | None = None, |
| 2528 | ) -> None: |
| 2529 | super().__init__() |
| 2530 | if not arg_names: |
| 2531 | arg_names = [None] * len(args) |
| 2532 | |
| 2533 | self.callee = callee |
| 2534 | self.args = args |
| 2535 | self.arg_kinds = arg_kinds # ARG_ constants |
| 2536 | # Each name can be None if not a keyword argument. |
| 2537 | self.arg_names: list[str | None] = arg_names |
| 2538 | # If not None, the node that represents the meaning of the CallExpr. For |
| 2539 | # cast(...) this is a CastExpr. |
| 2540 | self.analyzed = analyzed |
| 2541 | |
| 2542 | def accept(self, visitor: ExpressionVisitor[T]) -> T: |
| 2543 | return visitor.visit_call_expr(self) |
| 2544 | |
| 2545 | |
| 2546 | class YieldFromExpr(Expression): |
no outgoing calls
searching dependent graphs…