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

Method _visit

mypy/indirection.py:25–36  ·  view source on GitHub ↗
(self, typ: types.Type)

Source from the content-addressed store, hash-verified

23 return self.modules
24
25 def _visit(self, typ: types.Type) -> None:
26 # Note: instances are needed for `class str(Sequence[str]): ...`
27 if (
28 isinstance(typ, types.TypeAliasType)
29 or isinstance(typ, types.ProperType)
30 and isinstance(typ, types.Instance)
31 ):
32 # Avoid infinite recursion for recursive types.
33 if typ in self.seen_types:
34 return
35 self.seen_types.add(typ)
36 typ.accept(self)
37
38 def _visit_type_tuple(self, typs: tuple[types.Type, ...]) -> None:
39 # Micro-optimization: Specialized version of _visit for lists

Callers 12

find_modulesMethod · 0.95
visit_type_varMethod · 0.95
visit_param_specMethod · 0.95
visit_type_var_tupleMethod · 0.95
visit_instanceMethod · 0.95
visit_callable_typeMethod · 0.95
visit_overloadedMethod · 0.95
visit_tuple_typeMethod · 0.95
visit_typeddict_typeMethod · 0.95
visit_literal_typeMethod · 0.95
visit_type_typeMethod · 0.95
visit_type_alias_typeMethod · 0.95

Calls 3

isinstanceFunction · 0.85
addMethod · 0.45
acceptMethod · 0.45

Tested by

no test coverage detected