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

Method deserialize

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

Source from the content-addressed store, hash-verified

1547
1548 @classmethod
1549 def deserialize(cls, data: JsonDict) -> Var:
1550 assert data[".class"] == "Var"
1551 name = data["name"]
1552 type = None if data["type"] is None else mypy.types.deserialize_type(data["type"])
1553 setter_type = (
1554 None
1555 if data["setter_type"] is None
1556 else mypy.types.deserialize_type(data["setter_type"])
1557 )
1558 v = Var(name, type)
1559 assert (
1560 setter_type is None
1561 or isinstance(setter_type, mypy.types.ProperType)
1562 and isinstance(setter_type, mypy.types.CallableType)
1563 )
1564 v.setter_type = setter_type
1565 v.is_ready = False # Override True default set in __init__
1566 v._fullname = data["fullname"]
1567 set_flags(v, data["flags"])
1568 v.final_value = data.get("final_value")
1569 return v
1570
1571 def write(self, data: WriteBuffer) -> None:
1572 write_tag(data, VAR)

Callers 10

find_cache_metaFunction · 0.45
load_treeMethod · 0.45
deserializeMethod · 0.45
deserializeMethod · 0.45
deserializeMethod · 0.45
deserializeMethod · 0.45
deserializeMethod · 0.45
deserializeMethod · 0.45
deserializeMethod · 0.45
deserializeMethod · 0.45

Calls 4

VarClass · 0.85
isinstanceFunction · 0.85
set_flagsFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected