def visit_mypy_file(self, o: MypyFile) -> None: """Transform an file.""" res = [] # type: List[Node] for d in o.defs: if isinstance(d, ClassDef): self._type_context = d.info res.extend(self.type_tf.transform_class_def(d)) self._type_context = None else: d.accept(self) res.append(d) o.defs = res
def visit_mypy_file(self, node: MypyFile) -> None: node = self.fixup(node) node.defs = self.replace_statements(node.defs) super().visit_mypy_file(node)