API reference
python:astx:astx.packages.ImportFromStmt
class ImportFromStmt
ImportFromStmt(names: list[AliasExpr], module: str = '', level: int = 0, loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Source: packages/astx/src/astx/packages.py:404
Represents an import-from statement.
Attributes
-
kind — Type: ASTKind
-
module — Type: Optional[str]
-
names — Type: list[AliasExpr]
-
level — Type: int
Methods
-
__init__ — Initialize the import-from statement.
-
__str__ — Return a string representation of the import-from statement.
-
get_struct — Return the AST structure of the import-from statement.