MCPcopy Create free account
hub / github.com/sphinx-doc/sphinx / add_definition

Method add_definition

sphinx/pycode/parser.py:526–532  ·  view source on GitHub ↗

Add a location of definition.

(self, name: str, entry: tuple[str, int, int])

Source from the content-addressed store, hash-verified

524 self.definitions: dict[str, tuple[str, int, int]] = {}
525
526 def add_definition(self, name: str, entry: tuple[str, int, int]) -> None:
527 """Add a location of definition."""
528 if self.indents and self.indents[-1][0] == entry[0] == 'def':
529 # ignore definition of inner function
530 pass
531 else:
532 self.definitions[name] = entry
533
534 def parse(self) -> None:
535 """Parse the code to obtain location of definitions."""

Callers 2

parse_definitionMethod · 0.95
finalize_blockMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected