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

Method read

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

Source from the content-addressed store, hash-verified

1091
1092class _DefaultPolicyStatefulSerializer(StatefulSerializer):
1093 def read(self, read_context):
1094 args = read_context.read_ref()
1095 kwargs = read_context.read_ref()
1096 state = read_context.read_ref()
1097
1098 if args or kwargs:
1099 # Case 1: __getnewargs__ was used. Re-create by calling __init__.
1100 obj = self.cls(*args, **kwargs)
1101 else:
1102 # Case 2: Only __getstate__ was used. Create without calling __init__.
1103 obj = self.cls.__new__(self.cls)
1104
1105 if state is not None:
1106 obj.__setstate__(state)
1107 return obj
1108
1109
1110class ReduceSerializer(Serializer):

Callers

nothing calls this directly

Calls 2

read_refMethod · 0.45
__setstate__Method · 0.45

Tested by

no test coverage detected