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

Method invalidate_dependencies

mypy/binder.py:544–555  ·  view source on GitHub ↗

Invalidate knowledge of types that include expr, but not expr itself. For example, when expr is foo.bar, invalidate foo.bar.baz. It is overly conservative: it invalidates globally, including in code paths unreachable from here.

(self, expr: BindableExpression)

Source from the content-addressed store, hash-verified

542 self.allow_jump(i)
543
544 def invalidate_dependencies(self, expr: BindableExpression) -> None:
545 """Invalidate knowledge of types that include expr, but not expr itself.
546
547 For example, when expr is foo.bar, invalidate foo.bar.baz.
548
549 It is overly conservative: it invalidates globally, including
550 in code paths unreachable from here.
551 """
552 key = literal_hash(expr)
553 assert key is not None
554 for dep in self.dependencies.get(key, set()):
555 self._cleanse_key(dep)
556
557 def allow_jump(self, index: int) -> None:
558 # self.frames and self.options_on_return have different lengths

Callers 1

assign_typeMethod · 0.95

Calls 4

_cleanse_keyMethod · 0.95
literal_hashFunction · 0.90
setClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected