]> granicus.if.org Git - python/commit
Raise PicklingError when __reduce__() fails, and
authorJeremy Hylton <jeremy@alum.mit.edu>
Fri, 24 Jan 2003 19:29:52 +0000 (19:29 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Fri, 24 Jan 2003 19:29:52 +0000 (19:29 +0000)
commit3422c99de1d1c001ebc1416e3efc1b10452347b5
tree1a2ec5eb8d8719c98528b467ecb88032167e17f8
parent234d9a9eb390fc0975ca6fe8d010c45642bcdfed
Raise PicklingError when __reduce__() fails, and
add memoize() helper function to update the memo.

The first element of the tuple returned by __reduce__() must be a
callable.  If it isn't the Unpickler will raise an error.  Catch this
error in the pickler and raise the error there.

The memoize() helper also has a comment explaining how the memo
works.  So methods can't use memoize() because the write funny codes.
Lib/pickle.py