MCPcopy
hub / github.com/python/mypy / refresh_partial

Method refresh_partial

mypy/semanal.py:683–705  ·  view source on GitHub ↗

Refresh a stale target in fine-grained incremental mode.

(
        self,
        node: MypyFile | FuncDef | OverloadedFuncDef,
        patches: list[tuple[int, Callable[[], None]]],
        final_iteration: bool,
        file_node: MypyFile,
        options: Options,
        active_type: TypeInfo | None = None,
    )

Source from the content-addressed store, hash-verified

681 #
682
683 def refresh_partial(
684 self,
685 node: MypyFile | FuncDef | OverloadedFuncDef,
686 patches: list[tuple[int, Callable[[], None]]],
687 final_iteration: bool,
688 file_node: MypyFile,
689 options: Options,
690 active_type: TypeInfo | None = None,
691 ) -> None:
692 """Refresh a stale target in fine-grained incremental mode."""
693 self.patches = patches
694 self.deferred = False
695 self.incomplete = False
696 self._final_iteration = final_iteration
697 self.missing_names[-1] = set()
698
699 with self.file_context(file_node, options, active_type):
700 if isinstance(node, MypyFile):
701 self.refresh_top_level(node)
702 else:
703 self.recurse_into_functions = True
704 self.accept(node)
705 del self.patches
706
707 def refresh_top_level(self, file_node: MypyFile) -> None:
708 """Reanalyze a stale module top-level in fine-grained incremental mode."""

Callers 1

semantic_analyze_targetFunction · 0.80

Calls 5

file_contextMethod · 0.95
refresh_top_levelMethod · 0.95
acceptMethod · 0.95
setClass · 0.85
isinstanceFunction · 0.85

Tested by

no test coverage detected