(self, idx)
| 512 | |
| 513 | # Return a PUT (BINPUT, LONG_BINPUT) opcode string, with argument i. |
| 514 | def put(self, idx): |
| 515 | if self.proto >= 4: |
| 516 | return MEMOIZE |
| 517 | elif self.bin: |
| 518 | if idx < 256: |
| 519 | return BINPUT + pack("<B", idx) |
| 520 | else: |
| 521 | return LONG_BINPUT + pack("<I", idx) |
| 522 | else: |
| 523 | return PUT + repr(idx).encode("ascii") + b'\n' |
| 524 | |
| 525 | # Return a GET (BINGET, LONG_BINGET) opcode string, with argument i. |
| 526 | def get(self, i): |