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