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:353
Represents an import-from statement.
Attributes
-
kind — Kind of value or operation.; Type: ASTKind
-
module — Module to process.; Type: Optional[str]
-
names — Names.; Type: list[AliasExpr]
-
level — Level.; Type: int
-
loc — Type: SourceLocation
-
comment — Type: str
-
parent — Type: Optional[ASTNodes]
-
ref — Type: str
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.