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

Method visit_instance

mypy/server/astdiff.py:399–414  ·  view source on GitHub ↗
(self, typ: Instance)

Source from the content-addressed store, hash-verified

397 return snapshot_simple_type(typ)
398
399 def visit_instance(self, typ: Instance) -> SnapshotItem:
400 extra_attrs: SnapshotItem
401 if typ.extra_attrs:
402 extra_attrs = (
403 tuple(sorted((k, v.accept(self)) for k, v in typ.extra_attrs.attrs.items())),
404 tuple(typ.extra_attrs.immutable),
405 )
406 else:
407 extra_attrs = ()
408 return (
409 "Instance",
410 encode_optional_str(typ.type.fullname),
411 snapshot_types(typ.args),
412 ("None",) if typ.last_known_value is None else snapshot_type(typ.last_known_value),
413 extra_attrs,
414 )
415
416 def visit_type_var(self, typ: TypeVarType) -> SnapshotItem:
417 return (

Callers

nothing calls this directly

Calls 7

tupleClass · 0.85
sortedFunction · 0.85
encode_optional_strFunction · 0.85
snapshot_typesFunction · 0.85
snapshot_typeFunction · 0.85
acceptMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected