Write a pickled representation of obj to the open file.
(self, obj)
| 501 | self.memo.clear() |
| 502 | |
| 503 | def dump(self, obj): |
| 504 | """Write a pickled representation of obj to the open file.""" |
| 505 | # Check whether Pickler was initialized correctly. This is |
| 506 | # only needed to mimic the behavior of _pickle.Pickler.dump(). |
| 507 | if not hasattr(self, "_file_write"): |
| 508 | raise PicklingError("Pickler.__init__() was not called by " |
| 509 | "%s.__init__()" % (self.__class__.__name__,)) |
| 510 | if self.proto >= 2: |
| 511 | self.write(PROTO + pack("<B", self.proto)) |
| 512 | if self.proto >= 4: |
| 513 | self.framer.start_framing() |
| 514 | self.save(obj) |
| 515 | self.write(STOP) |
| 516 | self.framer.end_framing() |
| 517 | |
| 518 | def memoize(self, obj): |
| 519 | """Store an object in the memo.""" |
no test coverage detected