diff options
author | Tim Peters <tim.peters@gmail.com> | 2003-01-28 01:41:51 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2003-01-28 01:41:51 (GMT) |
commit | c23d18a955db63723a21d1e602cc8edae0940b8e (patch) | |
tree | 4f81466d6e8c451fd67d389536d2a0bcde32f615 | |
parent | 064567e41a4a0a2e717e9cc5ec960f366bd8491c (diff) | |
download | cpython-c23d18a955db63723a21d1e602cc8edae0940b8e.zip cpython-c23d18a955db63723a21d1e602cc8edae0940b8e.tar.gz cpython-c23d18a955db63723a21d1e602cc8edae0940b8e.tar.bz2 |
Comments.
-rw-r--r-- | Lib/pickle.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/pickle.py b/Lib/pickle.py index 957a87f..b6fb419 100644 --- a/Lib/pickle.py +++ b/Lib/pickle.py @@ -561,7 +561,7 @@ class Pickler: # This method does not use memoize() so that it can handle # the special case for non-binary mode. # XXX What did that comment mean? That is, what "special case for - # XXX non-binary mode? It sure *looks* like nothing special is + # XXX non-binary mode"? It sure *looks* like nothing special is # XXX happening in the INST case. memo_len = len(memo) if self.bin: @@ -699,6 +699,14 @@ class Unpickler: except _Stop, stopinst: return stopinst.value + # Return largest index k such that self.stack[k] is self.mark. + # If the stack doesn't contain a mark, eventually raises IndexError. + # This could be sped by maintaining another stack, of indices at which + # the mark appears. For that matter, the latter stack would suffice, + # and we wouldn't need to push mark objects on self.stack at all. + # Doing so is probably a good thing, though, since if the pickle is + # corrupt (or hostile) we may get a clue from finding self.mark embedded + # in unpickled objects. def marker(self): stack = self.stack mark = self.mark |