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

Method require_name

mypy/stubutil.py:517–520  ·  view source on GitHub ↗
(self, name: str)

Source from the content-addressed store, hash-verified

515 name = name.rpartition(".")[0]
516
517 def require_name(self, name: str) -> None:
518 while name not in self.direct_imports and "." in name:
519 name = name.rsplit(".", 1)[0]
520 self.required_names.add(name)
521
522 def reexport(self, name: str) -> None:
523 """Mark a given non qualified name as needed in __all__.

Callers 10

add_import_fromMethod · 0.95
reexportMethod · 0.95
visit_anyMethod · 0.80
visit_unbound_typeMethod · 0.80
_visit_ref_exprMethod · 0.80
_get_func_argsMethod · 0.80
visit_class_defMethod · 0.80
get_class_decoratorsMethod · 0.80
process_typealiasMethod · 0.80
add_decoratorMethod · 0.80

Calls 2

rsplitMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected