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

Method _save_bytes_no_memo

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

Source from the content-addressed store, hash-verified

842 dispatch[float] = save_float
843
844 def _save_bytes_no_memo(self, obj):
845 # helper for writing bytes objects for protocol >= 3
846 # without memoizing them
847 assert self.proto >= 3
848 n = len(obj)
849 if n <= 0xff:
850 self.write(SHORT_BINBYTES + pack("<B", n) + obj)
851 elif n > 0xffffffff and self.proto >= 4:
852 self._write_large_bytes(BINBYTES8 + pack("<Q", n), obj)
853 elif n >= self.framer._FRAME_SIZE_TARGET:
854 self._write_large_bytes(BINBYTES + pack("<I", n), obj)
855 else:
856 self.write(BINBYTES + pack("<I", n) + obj)
857
858 def save_bytes(self, obj):
859 if self.proto < 3:

Callers 2

save_bytesMethod · 0.95
save_picklebufferMethod · 0.95

Calls 3

packFunction · 0.90
lenFunction · 0.85
writeMethod · 0.45

Tested by

no test coverage detected