Import
Bases: Symbol
Represents an import.
Attributes:
| Name | Type | Description |
|---|---|---|
node |
ImportFrom | Import
|
The node that defines the import. |
name |
The name of the symbol that is imported if any is given. Else it is equal to the module name. |
|
module |
str
|
The name of the module that is imported. |
alias |
str | None
|
If the node is of type Import alias is the alias name for the module name if any is given. If the node is of type ImportFrom alias is the alias name for the name of the symbol if any is given. |
inferred_node |
NodeNG | None
|
When the import is used as a reference (or a symbol) the inferred_node is the node of the used reference (or symbol) in the original module. It was inferred by the reference analysis by using astroids safe_infer method. If the method could not infer the node, the inferred_node is None. |
call |
Call | None
|
The original call node as fallback for the case, that the purity of the inferred_node cannot be inferred. Only is set if the symbol represents a call. |