MCPcopy Create free account
hub / github.com/python/cpython / _save_bytearray_no_memo

Method _save_bytearray_no_memo

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

Source from the content-addressed store, hash-verified

884 dispatch[bytes] = save_bytes
885
886 def _save_bytearray_no_memo(self, obj):
887 # helper for writing bytearray objects for protocol >= 5
888 # without memoizing them
889 assert self.proto >= 5
890 n = len(obj)
891 if n >= self.framer._FRAME_SIZE_TARGET:
892 self._write_large_bytes(BYTEARRAY8 + pack("<Q", n), obj)
893 else:
894 self.write(BYTEARRAY8 + pack("<Q", n) + obj)
895
896 def save_bytearray(self, obj):
897 if self.proto < 5:

Callers 2

save_bytearrayMethod · 0.95
save_picklebufferMethod · 0.95

Calls 2

packFunction · 0.85
writeMethod · 0.45

Tested by

no test coverage detected