Write a pickled representation of obj to the open file.
(self, obj)
| 474 | self.memo.clear() |
| 475 | |
| 476 | def dump(self, obj): |
| 477 | """Write a pickled representation of obj to the open file.""" |
| 478 | # Check whether Pickler was initialized correctly. This is |
| 479 | # only needed to mimic the behavior of _pickle.Pickler.dump(). |
| 480 | if not hasattr(self, "_file_write"): |
| 481 | raise PicklingError("Pickler.__init__() was not called by " |
| 482 | "%s.__init__()" % (self.__class__.__name__,)) |
| 483 | if self.proto >= 2: |
| 484 | self.write(PROTO + pack("<B", self.proto)) |
| 485 | if self.proto >= 4: |
| 486 | self.framer.start_framing() |
| 487 | self.save(obj) |
| 488 | self.write(STOP) |
| 489 | self.framer.end_framing() |
| 490 | |
| 491 | def memoize(self, obj): |
| 492 | """Store an object in the memo.""" |
no test coverage detected