MCPcopy Index your code
hub / github.com/RustPython/RustPython / save_set

Method save_set

Lib/pickle.py:1105–1124  ·  view source on GitHub ↗
(self, obj)

Source from the content-addressed store, hash-verified

1103 write(SETITEM)
1104
1105 def save_set(self, obj):
1106 save = self.save
1107 write = self.write
1108
1109 if self.proto < 4:
1110 self.save_reduce(set, (list(obj),), obj=obj)
1111 return
1112
1113 write(EMPTY_SET)
1114 self.memoize(obj)
1115
1116 for batch in batched(obj, self._BATCHSIZE):
1117 write(MARK)
1118 try:
1119 for item in batch:
1120 save(item)
1121 except BaseException as exc:
1122 exc.add_note(f'when serializing {_T(obj)} element')
1123 raise
1124 write(ADDITEMS)
1125 dispatch[set] = save_set
1126
1127 def save_frozenset(self, obj):

Callers

nothing calls this directly

Calls 6

save_reduceMethod · 0.95
memoizeMethod · 0.95
listClass · 0.85
_TFunction · 0.85
add_noteMethod · 0.80
writeFunction · 0.70

Tested by

no test coverage detected