MCPcopy Index your code
hub / github.com/python/mypy / record_name

Method record_name

mypy/stubutil.py:727–733  ·  view source on GitHub ↗

Mark a name as defined. This only does anything if at the top level of a module.

(self, name: str)

Source from the content-addressed store, hash-verified

725 self._indent = self._indent[:-4]
726
727 def record_name(self, name: str) -> None:
728 """Mark a name as defined.
729
730 This only does anything if at the top level of a module.
731 """
732 if self.is_top_level():
733 self._toplevel_names.append(name)
734
735 def is_recorded_name(self, name: str) -> bool:
736 """Has this name been recorded previously?"""

Callers 11

visit_func_defMethod · 0.80
visit_class_defMethod · 0.80
visit_assignment_stmtMethod · 0.80
process_typealiasMethod · 0.80
visit_type_alias_stmtMethod · 0.80
visit_import_fromMethod · 0.80
visit_importMethod · 0.80
generate_class_stubMethod · 0.80

Calls 2

is_top_levelMethod · 0.95
appendMethod · 0.80

Tested by

no test coverage detected