API reference
python:astx:astx.classes.ClassDeclStmt
class ClassDeclStmt
ClassDeclStmt(name: str, bases: Iterable[Expr] | ASTNodes[Expr] = [], decorators: Iterable[Expr] | ASTNodes[Expr] = [], visibility: VisibilityKind = VisibilityKind.public, is_abstract: bool = False, metaclass: Optional[Expr] = None, attributes: Iterable[VariableDeclaration] | ASTNodes[VariableDeclaration] = [], methods: Iterable[FunctionDef] | ASTNodes[FunctionDef] = [], loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Source: packages/astx/src/astx/classes.py:30
AST class for class declaration.
Attributes
-
kind — Type: ASTKind
-
name — Type: str
-
bases — Type: ASTNodes[Expr]
-
decorators — Type: ASTNodes[Expr]
-
visibility — Type: VisibilityKind
-
is_abstract — Type: bool
-
metaclass — Type: Optional[Expr]
-
attributes — Type: ASTNodes[VariableDeclaration]
-
methods — Type: ASTNodes[FunctionDef]
Methods
-
__init__ — Initialize ClassDeclStmt instance.
-
__str__ — Return a string that represents the object.
-
_get_struct_wrapper — Return the AST structure of the object.
-
get_struct — Return the AST structure of the object.