Import#

class astroid.nodes.Import(names: list[tuple[str, str | None]], lineno: int | None = None, col_offset: int | None = None, parent: NodeNG | None = None, *, end_lineno: int | None = None, end_col_offset: int | None = None)[source]#

Bases: ImportNode

Class representing an ast.Import node. >>> import astroid >>> node = astroid.extract_node(‘import astroid’) >>> node <Import l.1 at 0x7f23b2e4e5c0>

names: list[tuple[str, str | None]]#

The names being imported.

Each entry is a tuple of the name being imported, and the alias that the name is assigned to (if any).