MCPcopy Create free account
hub / github.com/python/mypy / add_attribute_dependency

Method add_attribute_dependency

mypy/server/deps.py:898–902  ·  view source on GitHub ↗

Add dependencies for accessing a named attribute of a type.

(self, typ: Type, name: str)

Source from the content-addressed store, hash-verified

896 self.add_dependency(trigger, target)
897
898 def add_attribute_dependency(self, typ: Type, name: str) -> None:
899 """Add dependencies for accessing a named attribute of a type."""
900 targets = self.attribute_triggers(typ, name)
901 for target in targets:
902 self.add_dependency(target)
903
904 def attribute_triggers(self, typ: Type, name: str) -> list[str]:
905 """Return all triggers associated with the attribute of a type."""

Callers 5

visit_for_stmtMethod · 0.95
visit_member_exprMethod · 0.95
visit_call_exprMethod · 0.95
add_iter_dependencyMethod · 0.95

Calls 2

attribute_triggersMethod · 0.95
add_dependencyMethod · 0.95

Tested by

no test coverage detected