MCPcopy Index your code
hub / github.com/apache/fory / read

Method read

python/pyfory/serializer.py:1073–1089  ·  view source on GitHub ↗
(self, read_context)

Source from the content-addressed store, hash-verified

1071 write_context.write_ref(state)
1072
1073 def read(self, read_context):
1074 args = read_context.read_ref()
1075 kwargs = read_context.read_ref()
1076 state = read_context.read_ref()
1077
1078 read_context.policy.authorize_instantiation(self.cls)
1079 if args or kwargs:
1080 # Case 1: __getnewargs__ was used. Re-create by calling __init__.
1081 obj = self.cls(*args, **kwargs)
1082 else:
1083 # Case 2: Only __getstate__ was used. Create without calling __init__.
1084 obj = self.cls.__new__(self.cls)
1085
1086 if state is not None:
1087 read_context.policy.intercept_setstate(obj, state)
1088 obj.__setstate__(state)
1089 return obj
1090
1091
1092class _DefaultPolicyStatefulSerializer(StatefulSerializer):

Callers

nothing calls this directly

Calls 4

read_refMethod · 0.45
intercept_setstateMethod · 0.45
__setstate__Method · 0.45

Tested by

no test coverage detected