Skip to main content

Function Definition AST Python Object

The FunctionDefinition object matches a Python function declaration.

The astType value for this node is functiondefinition.

Code Pattern

This object captures the following code block.

def my_function(arg1 = default_value, arg2 = other_value):
...

Attributes

  • isAsync (type bool): is the function async
  • decorators (list of PythonDecorator): list of decorators
  • name (type AstString): name of the function
  • returnType (type AstString): return type of the function
  • parameters (type FunctionDefinitionParameters): list of parameters for the function

Examples of rules