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