(self, read_context)
| 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 | |
| 1092 | class _DefaultPolicyStatefulSerializer(StatefulSerializer): |
nothing calls this directly
no test coverage detected