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

Method _batch_appends

tools/python-3.11.9-amd64/Lib/pickle.py:938–963  ·  view source on GitHub ↗
(self, items)

Source from the content-addressed store, hash-verified

936 _BATCHSIZE = 1000
937
938 def _batch_appends(self, items):
939 # Helper to batch up APPENDS sequences
940 save = self.save
941 write = self.write
942
943 if not self.bin:
944 for x in items:
945 save(x)
946 write(APPEND)
947 return
948
949 it = iter(items)
950 while True:
951 tmp = list(islice(it, self._BATCHSIZE))
952 n = len(tmp)
953 if n > 1:
954 write(MARK)
955 for x in tmp:
956 save(x)
957 write(APPENDS)
958 elif n:
959 save(tmp[0])
960 write(APPEND)
961 # else tmp is empty, and we're done
962 if n < self._BATCHSIZE:
963 return
964
965 def save_dict(self, obj):
966 if self.bin:

Callers 2

save_reduceMethod · 0.95
save_listMethod · 0.95

Calls 2

listFunction · 0.85
writeFunction · 0.70

Tested by

no test coverage detected