MCPcopy
hub / github.com/python/mypy / deserialize

Method deserialize

mypy/nodes.py:4971–4993  ·  view source on GitHub ↗
(cls, data: JsonDict)

Source from the content-addressed store, hash-verified

4969
4970 @classmethod
4971 def deserialize(cls, data: JsonDict) -> SymbolTableNode:
4972 assert data[".class"] == "SymbolTableNode"
4973 kind = inverse_node_kinds[data["kind"]]
4974 if "cross_ref" in data:
4975 # This will be fixed up later.
4976 stnode = SymbolTableNode(kind, None)
4977 stnode.cross_ref = data["cross_ref"]
4978 stnode.unfixed = True
4979 else:
4980 assert "node" in data, data
4981 node = SymbolNode.deserialize(data["node"])
4982 stnode = SymbolTableNode(kind, node)
4983 if not isinstance(node, TypeInfo):
4984 stnode.unfixed = True
4985 if "module_hidden" in data:
4986 stnode.module_hidden = data["module_hidden"]
4987 if "module_public" in data:
4988 stnode.module_public = data["module_public"]
4989 if "implicit" in data:
4990 stnode.implicit = data["implicit"]
4991 if "plugin_generated" in data:
4992 stnode.plugin_generated = data["plugin_generated"]
4993 return stnode
4994
4995 def write(self, data: WriteBuffer, prefix: str, name: str) -> None:
4996 write_tag(data, SYMBOL_TABLE_NODE)

Callers

nothing calls this directly

Calls 3

SymbolTableNodeClass · 0.85
isinstanceFunction · 0.85
deserializeMethod · 0.45

Tested by

no test coverage detected