MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / save_set

Method save_set

tools/python-3.11.9-amd64/Lib/pickle.py:1009–1030  ·  view source on GitHub ↗
(self, obj)

Source from the content-addressed store, hash-verified

1007 return
1008
1009 def save_set(self, obj):
1010 save = self.save
1011 write = self.write
1012
1013 if self.proto < 4:
1014 self.save_reduce(set, (list(obj),), obj=obj)
1015 return
1016
1017 write(EMPTY_SET)
1018 self.memoize(obj)
1019
1020 it = iter(obj)
1021 while True:
1022 batch = list(islice(it, self._BATCHSIZE))
1023 n = len(batch)
1024 if n > 0:
1025 write(MARK)
1026 for item in batch:
1027 save(item)
1028 write(ADDITEMS)
1029 if n < self._BATCHSIZE:
1030 return
1031 dispatch[set] = save_set
1032
1033 def save_frozenset(self, obj):

Callers

nothing calls this directly

Calls 4

save_reduceMethod · 0.95
memoizeMethod · 0.95
listFunction · 0.85
writeFunction · 0.70

Tested by

no test coverage detected