Write a pickled representation of obj to the open file.
(self, obj)
| 485 | self.memo.clear() |
| 486 | |
| 487 | def dump(self, obj): |
| 488 | """Write a pickled representation of obj to the open file.""" |
| 489 | # Check whether Pickler was initialized correctly. This is |
| 490 | # only needed to mimic the behavior of _pickle.Pickler.dump(). |
| 491 | if not hasattr(self, "_file_write"): |
| 492 | raise PicklingError("Pickler.__init__() was not called by " |
| 493 | "%s.__init__()" % (self.__class__.__name__,)) |
| 494 | if self.proto >= 2: |
| 495 | self.write(PROTO + pack("<B", self.proto)) |
| 496 | if self.proto >= 4: |
| 497 | self.framer.start_framing() |
| 498 | self.save(obj) |
| 499 | self.write(STOP) |
| 500 | self.framer.end_framing() |
| 501 | |
| 502 | def memoize(self, obj): |
| 503 | """Store an object in the memo.""" |