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

Method deserialize

mypy/types.py:2593–2614  ·  view source on GitHub ↗
(cls, data: JsonDict)

Source from the content-addressed store, hash-verified

2591
2592 @classmethod
2593 def deserialize(cls, data: JsonDict) -> CallableType:
2594 assert data[".class"] == "CallableType"
2595 # The .definition link is set in fixup.py.
2596 return CallableType(
2597 [deserialize_type(t) for t in data["arg_types"]],
2598 [ARG_KINDS[x] for x in data["arg_kinds"]],
2599 data["arg_names"],
2600 deserialize_type(data["ret_type"]),
2601 Instance.deserialize(data["fallback"]),
2602 name=data["name"],
2603 variables=[cast(TypeVarLikeType, deserialize_type(v)) for v in data["variables"]],
2604 is_ellipsis_args=data["is_ellipsis_args"],
2605 implicit=data["implicit"],
2606 is_bound=data["is_bound"],
2607 type_guard=(
2608 deserialize_type(data["type_guard"]) if data["type_guard"] is not None else None
2609 ),
2610 type_is=(deserialize_type(data["type_is"]) if data["type_is"] is not None else None),
2611 from_concatenate=data["from_concatenate"],
2612 imprecise_arg_kinds=data["imprecise_arg_kinds"],
2613 unpack_kwargs=data["unpack_kwargs"],
2614 )
2615
2616 def write(self, data: WriteBuffer) -> None:
2617 write_tag(data, CALLABLE_TYPE)

Callers

nothing calls this directly

Calls 3

CallableTypeClass · 0.85
deserialize_typeFunction · 0.70
deserializeMethod · 0.45

Tested by

no test coverage detected