MCPcopy Index your code
hub / github.com/python/cpython / put

Method put

Lib/pickle.py:541–550  ·  view source on GitHub ↗
(self, idx)

Source from the content-addressed store, hash-verified

539
540 # Return a PUT (BINPUT, LONG_BINPUT) opcode string, with argument i.
541 def put(self, idx):
542 if self.proto >= 4:
543 return MEMOIZE
544 elif self.bin:
545 if idx < 256:
546 return BINPUT + pack("<B", idx)
547 else:
548 return LONG_BINPUT + pack("<I", idx)
549 else:
550 return PUT + repr(idx).encode("ascii") + b'\n'
551
552 # Return a GET (BINGET, LONG_BINGET) opcode string, with argument i.
553 def get(self, i):

Callers 1

memoizeMethod · 0.95

Calls 2

packFunction · 0.85
encodeMethod · 0.45

Tested by

no test coverage detected