(cls, data: JsonDict, ctx: DeserMaps)
| 438 | |
| 439 | @classmethod |
| 440 | def deserialize(cls, data: JsonDict, ctx: DeserMaps) -> ClassIR: |
| 441 | fullname = data["module_name"] + "." + data["name"] |
| 442 | assert fullname in ctx.classes, "Class %s not in deser class map" % fullname |
| 443 | ir = ctx.classes[fullname] |
| 444 | |
| 445 | ir.is_trait = data["is_trait"] |
| 446 | ir.is_generated = data["is_generated"] |
| 447 | ir.is_abstract = data["is_abstract"] |
| 448 | ir.is_ext_class = data["is_ext_class"] |
| 449 | ir.is_augmented = data["is_augmented"] |
| 450 | ir.is_final_class = data["is_final_class"] |
| 451 | ir.inherits_python = data["inherits_python"] |
| 452 | ir.has_dict = data["has_dict"] |
| 453 | ir.allow_interpreted_subclasses = data["allow_interpreted_subclasses"] |
| 454 | ir.needs_getseters = data["needs_getseters"] |
| 455 | ir._serializable = data["_serializable"] |
| 456 | ir.builtin_base = data["builtin_base"] |
| 457 | ir.ctor = FuncDecl.deserialize(data["ctor"], ctx) |
| 458 | ir.attributes = {k: deserialize_type(t, ctx) for k, t in data["attributes"]} |
| 459 | ir.method_decls = { |
| 460 | k: ctx.functions[v].decl if isinstance(v, str) else FuncDecl.deserialize(v, ctx) |
| 461 | for k, v in data["method_decls"] |
| 462 | } |
| 463 | ir.methods = {k: ctx.functions[v] for k, v in data["methods"]} |
| 464 | ir.glue_methods = { |
| 465 | (ctx.classes[c], k): ctx.functions[v] for (c, k), v in data["glue_methods"] |
| 466 | } |
| 467 | ir.property_types = {k: deserialize_type(t, ctx) for k, t in data["property_types"]} |
| 468 | ir.properties = { |
| 469 | k: (ir.methods[k], ir.methods.get(PROPSET_PREFIX + k)) for k in data["properties"] |
| 470 | } |
| 471 | |
| 472 | ir.vtable = data["vtable"] |
| 473 | ir.vtable_entries = deserialize_vtable(data["vtable_entries"], ctx) |
| 474 | ir.trait_vtables = { |
| 475 | ctx.classes[k]: deserialize_vtable(v, ctx) for k, v in data["trait_vtables"] |
| 476 | } |
| 477 | |
| 478 | base = data["base"] |
| 479 | ir.base = ctx.classes[base] if base else None |
| 480 | ir.traits = [ctx.classes[s] for s in data["traits"]] |
| 481 | ir.mro = [ctx.classes[s] for s in data["mro"]] |
| 482 | ir.base_mro = [ctx.classes[s] for s in data["base_mro"]] |
| 483 | ir.children = data["children"] and [ctx.classes[s] for s in data["children"]] |
| 484 | ir.deletable = data["deletable"] |
| 485 | ir.attrs_with_defaults = set(data["attrs_with_defaults"]) |
| 486 | ir._always_initialized_attrs = set(data["_always_initialized_attrs"]) |
| 487 | ir._sometimes_initialized_attrs = set(data["_sometimes_initialized_attrs"]) |
| 488 | ir.init_self_leak = data["init_self_leak"] |
| 489 | ir.env_user_function = ( |
| 490 | ctx.functions[data["env_user_function"]] if data["env_user_function"] else None |
| 491 | ) |
| 492 | ir.reuse_freed_instance = data["reuse_freed_instance"] |
| 493 | ir.is_acyclic = data.get("is_acyclic", False) |
| 494 | ir.is_enum = data["is_enum"] |
| 495 | ir.coroutine_name = data["is_coroutine"] |
| 496 | |
| 497 | return ir |
nothing calls this directly
no test coverage detected