MCPcopy Index your code
hub / github.com/sphinx-doc/sphinx / visit_Import

Method visit_Import

sphinx/pycode/parser.py:408–418  ·  view source on GitHub ↗

Handles Import node and record the order of definitions.

(self, node: ast.Import)

Source from the content-addressed store, hash-verified

406 self.previous = node
407
408 def visit_Import(self, node: ast.Import) -> None:
409 """Handles Import node and record the order of definitions."""
410 for name in node.names:
411 self.add_entry(name.asname or name.name)
412
413 if name.name in {'typing', 'typing_extensions'}:
414 self.typing_mods.add(name.asname or name.name)
415 elif name.name in {'typing.final', 'typing_extensions.final'}:
416 self.typing_final_names.add(name.asname or name.name)
417 elif name.name in {'typing.overload', 'typing_extensions.overload'}:
418 self.typing_overload_names.add(name.asname or name.name)
419
420 def visit_ImportFrom(self, node: ast.ImportFrom) -> None:
421 """Handles Import node and record the order of definitions."""

Callers

nothing calls this directly

Calls 2

add_entryMethod · 0.95
addMethod · 0.45

Tested by

no test coverage detected