astx.callables

astx.callables

Source: packages/astx/src/astx/callables.py

title: Module for callable ASTx.

Classes

Argument(Variable)

title: AST class for argument definition.
attributes:
  kind:
    type: ASTKind
  mutability:
    type: MutabilityKind
  name:
    type: str
  type_:
    type: DataType
  default:
    type: Expr

Methods

get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure of the object.
parameters:
  simplified:
    type: bool
returns:
  type: ReprStruct

Arguments(ASTNodes[Argument])

title: AST class for argument definition.

Methods

get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure of the object.
parameters:
  simplified:
    type: bool
returns:
  type: ReprStruct

FunctionCall(DataType)

title: AST class for function call.
attributes:
  kind:
    type: ASTKind
  fn:
    type: str
  args:
    type: Iterable[DataType]
  type_:
    type: DataType

Methods

get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure of the object.
parameters:
  simplified:
    type: bool
returns:
  type: ReprStruct

FunctionPrototype(StatementType)

title: AST class for function prototype declaration.
attributes:
  loc:
    type: SourceLocation
  kind:
    type: ASTKind
  name:
    type: str
  args:
    type: Arguments
  return_type:
    type: AnyType
  scope:
    type: ScopeKind
  visibility:
    type: VisibilityKind

Methods

get_struct(self, simplified: bool=False) -> ReprStruct
title: Get the AST structure that represent the object.
parameters:
  simplified:
    type: bool
returns:
  type: ReprStruct

FunctionReturn(StatementType)

title: AST class for function `return` statement.
attributes:
  kind:
    type: ASTKind
  value:
    type: DataType

Methods

get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure of the object.
parameters:
  simplified:
    type: bool
returns:
  type: ReprStruct

FunctionDef(StatementType)

title: AST class for function definition.
attributes:
  kind:
    type: ASTKind
  prototype:
    type: FunctionPrototype
  body:
    type: Block

Methods

name(self) -> str
title: Return the function prototype name.
returns:
  type: str
get_struct(self, simplified: bool=False) -> ReprStruct
title: Get the AST structure that represent the object.
parameters:
  simplified:
    type: bool
returns:
  type: ReprStruct

LambdaExpr(Expr)

title: AST class for lambda expressions.
attributes:
  kind:
    type: ASTKind
  params:
    type: Arguments
  body:
    type: Expr

Methods

get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure of the lambda expression.
parameters:
  simplified:
    type: bool
returns:
  type: ReprStruct

FunctionAsyncDef(FunctionDef)

title: AST class for async function definition.
attributes:
  kind:
    type: ASTKind
  prototype:
    type: FunctionPrototype
  body:
    type: Block

Methods

get_struct(self, simplified: bool=False) -> ReprStruct
title: Get the AST structure that represent the object.
parameters:
  simplified:
    type: bool
returns:
  type: ReprStruct

AwaitExpr(Expr)

title: AST class for AwaitExpr.
attributes:
  kind:
    type: ASTKind
  value:
    type: Optional[Expr]

Methods

get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure of the object.
parameters:
  simplified:
    type: bool
returns:
  type: ReprStruct

YieldExpr(Expr)

title: AST class for YieldExpr.
attributes:
  kind:
    type: ASTKind
  value:
    type: Optional[Expr]

Methods

get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure of the object.
parameters:
  simplified:
    type: bool
returns:
  type: ReprStruct

YieldStmt(StatementType)

title: AST class for yield statement.
attributes:
  kind:
    type: ASTKind
  value:
    type: Optional[Expr]

Methods

get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure of the object.
parameters:
  simplified:
    type: bool
returns:
  type: ReprStruct

YieldFromExpr(Expr)

title: AST class for YieldFromExpr.
attributes:
  kind:
    type: ASTKind
  value:
    type: Expr

Methods

get_struct(self, simplified: bool=False) -> ReprStruct
title: Return the AST structure of the object.
parameters:
  simplified:
    type: bool
returns:
  type: ReprStruct