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

Method visit_Module

mypy/fastparse.py:878–894  ·  view source on GitHub ↗
(self, mod: ast3.Module)

Source from the content-addressed store, hash-verified

876 return id
877
878 def visit_Module(self, mod: ast3.Module) -> MypyFile:
879 self.type_ignores = {}
880 self.uses_template_strings = False
881 for ti in mod.type_ignores:
882 parsed = parse_type_ignore_tag(ti.tag)
883 if parsed is not None:
884 self.type_ignores[ti.lineno] = parsed
885 else:
886 self.fail(message_registry.INVALID_TYPE_IGNORE, ti.lineno, -1, blocker=False)
887
888 body = self.fix_function_overloads(self.translate_stmt_list(mod.body, ismodule=True))
889
890 ret = MypyFile(body, self.imports, False, ignored_lines=self.type_ignores)
891 ret.is_stub = self.is_stub
892 ret.path = self.path
893 ret.uses_template_strings = self.uses_template_strings
894 return ret
895
896 # --- stmt ---
897 # FunctionDef(identifier name, arguments args,

Callers

nothing calls this directly

Calls 5

failMethod · 0.95
translate_stmt_listMethod · 0.95
MypyFileClass · 0.90
parse_type_ignore_tagFunction · 0.85

Tested by

no test coverage detected