API reference
python:astx:astx.ClassDefStmt
class ClassDefStmt
ClassDefStmt(name: str, *, bases: Iterable[ClassType] | astx.ASTNodes[ClassType] = (), attributes: Iterable[astx.VariableDeclaration] | astx.ASTNodes[astx.VariableDeclaration] = (), decorators: Iterable[astx.Expr] | astx.ASTNodes[astx.Expr] = (), methods: Iterable[astx.FunctionDef] | astx.ASTNodes[astx.FunctionDef] = (), visibility: VisibilityKind = VisibilityKind.public, is_abstract: bool = False, loc: astx.SourceLocation = NO_SOURCE_LOCATION, parent: astx.ASTNodes[astx.AST] | None = None)
Source: packages/astx/src/astx/classes_ext.py:97
Declared as: python:astx:astx.classes_ext.ClassDefStmt
Explicit class definition statement.
Represent one top-level class declaration with explicit base-class references and inherited struct-like member containers.
Attributes
-
bases — Type: astx.ASTNodes[ClassType]
-
is_abstract — Type: bool
-
kind — Type: astx.ASTKind
Methods
-
__init__ — Initialize one class definition statement.
-
__str__ — Render one class definition as text.
-
get_struct — Build one repr structure for a class definition.