Handles FunctionDef node and set context.
(self, node: ast.FunctionDef)
| 482 | self.current_classes.pop() |
| 483 | |
| 484 | def visit_FunctionDef(self, node: ast.FunctionDef) -> None: |
| 485 | """Handles FunctionDef node and set context.""" |
| 486 | if self.current_function is None: |
| 487 | # should be called before setting self.current_function |
| 488 | self.add_entry(node.name) |
| 489 | if self.is_final(node.decorator_list): |
| 490 | self.add_final_entry(node.name) |
| 491 | if self.is_overload(node.decorator_list): |
| 492 | self.add_overload_entry(node) |
| 493 | self.context.append(node.name) |
| 494 | self.current_function = node |
| 495 | for child in node.body: |
| 496 | self.visit(child) |
| 497 | self.context.pop() |
| 498 | self.current_function = None |
| 499 | |
| 500 | def visit_AsyncFunctionDef(self, node: ast.AsyncFunctionDef) -> None: |
| 501 | """Handles AsyncFunctionDef node and set context.""" |
no test coverage detected