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

Method save_frozenset

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

Source from the content-addressed store, hash-verified

1125 dispatch[set] = save_set
1126
1127 def save_frozenset(self, obj):
1128 save = self.save
1129 write = self.write
1130
1131 if self.proto < 4:
1132 self.save_reduce(frozenset, (list(obj),), obj=obj)
1133 return
1134
1135 write(MARK)
1136 try:
1137 for item in obj:
1138 save(item)
1139 except BaseException as exc:
1140 exc.add_note(f'when serializing {_T(obj)} element')
1141 raise
1142
1143 if id(obj) in self.memo:
1144 # If the object is already in the memo, this means it is
1145 # recursive. In this case, throw away everything we put on the
1146 # stack, and fetch the object back from the memo.
1147 write(POP_MARK + self.get(self.memo[id(obj)][0]))
1148 return
1149
1150 write(FROZENSET)
1151 self.memoize(obj)
1152 dispatch[frozenset] = save_frozenset
1153
1154 def save_global(self, obj, name=None):

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected