MCPcopy
hub / github.com/python/mypy / ImportFrom

Class ImportFrom

mypy/nodes.py:661–679  ·  view source on GitHub ↗

from m import x [as y], ...

Source from the content-addressed store, hash-verified

659
660
661class ImportFrom(ImportBase):
662 """from m import x [as y], ..."""
663
664 __slots__ = ("id", "names", "relative")
665
666 __match_args__ = ("id", "names", "relative")
667
668 id: str
669 relative: int
670 names: list[tuple[str, str | None]] # Tuples (name, as name)
671
672 def __init__(self, id: str, relative: int, names: list[tuple[str, str | None]]) -> None:
673 super().__init__()
674 self.id = id
675 self.names = names
676 self.relative = relative
677
678 def accept(self, visitor: StatementVisitor[T]) -> T:
679 return visitor.visit_import_from(self)
680
681
682class ImportAll(ImportBase):

Callers 4

visit_ImportFromMethod · 0.90
visit_import_fromMethod · 0.90
read_statementFunction · 0.90
deserialize_importsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…