API reference
python:astx:astx.AliasExpr
class AliasExpr
AliasExpr(name: str, asname: str = '', loc: SourceLocation = NO_SOURCE_LOCATION, parent: Optional[ASTNodes] = None)
Source: packages/astx/src/astx/packages.py:239
Declared as: python:astx:astx.packages.AliasExpr
Represents an alias in an import statement.
Attributes
-
kind — Kind of value or operation.; Type: ASTKind
-
name — Name identifying this declaration.; Type: str
-
asname — Asname.; Type: str
-
loc — Type: SourceLocation
-
comment — Type: str
-
parent — Type: Optional[ASTNodes]
-
ref — Type: str
-
nbytes — Type: int
Methods
-
__init__ — Initialize the alias expression.
-
__str__ — Return a string representation of the alias.
-
get_struct — Return the AST structure of the alias.