API reference
python:astx:astx.FunctionDef
class FunctionDef
FunctionDef(prototype: FunctionPrototype, body: Block, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Source: packages/astx/src/astx/callables.py:464
Declared as: python:astx:astx.callables.FunctionDef
AST class for function definition.
Attributes
-
kind — Type: ASTKind
-
prototype — Type: FunctionPrototype
-
body — Type: Block
Methods
-
__call__ — Initialize the Call instance.
-
__init__ — Initialize the Function instance.
-
__str__ — Return a string that represent the object.
-
get_struct — Get the AST structure that represent the object.
Properties
- name — Return the function prototype name.