ImportStatementPackage AST Python Object
The ImportStatementPackage
object matches a Python import.
The astType
value for this node is importpackage
.
Code Pattern
This object catches the parts package1
or package2 as asname
in the following code pattern
import package1, package2 as asname
Attributes
name
(typeAstString
): name of the imported packageas
(typeAstString
): if package is renamed, this captures theas
part of the import. Otherwise, the value isnull
.