Staging
v0.8.1
https://github.com/python/cpython
Revision d1f4984a9bb2e90d4fc473be1a169917277efa4d authored by Guido van Rossum on 10 December 1997, 23:40:18 UTC, committed by Guido van Rossum on 10 December 1997, 23:40:18 UTC
The attached patch adds the following behavior to the handling
of REDUCE codes:

- A user-defined type may have a __reduce__ method that returns
  a string rather than a tuple, in which case the object is
  saved as a global object with a name given by the string returned
  by reduce.

  This was a feature added to cPickle a long time ago.


- User-defined types can now support unpickling without
  executing a constructor.

  The second value returned from '__reduce__' can now be None,
  rather than an argument tuple.  On unpickling, if the
  second value returned from '__reduce__' during pickling was
  None, then rather than calling the first value returned from
  '__reduce__', directly, the '__basicnew__' method of the
  first value returned from '__reduce__' is called without
  arguments.

I also got rid of a few of Chris' extra ()s, which he used
to make python ifs look like C ifs.
1 parent 79f016a
History
Tip revision: d1f4984a9bb2e90d4fc473be1a169917277efa4d authored by Guido van Rossum on 10 December 1997, 23:40:18 UTC
Jim Fulton writes:
Tip revision: d1f4984
File Mode Size
ACKS -rw-r--r-- 2.9 KB
AIX-NOTES -rw-r--r-- 7.3 KB
BLURB -rw-r--r-- 1.6 KB
BLURB.LUTZ -rw-r--r-- 5.6 KB
BLURB.WINDOWS -rw-r--r-- 3.8 KB
COPYRIGHT -rw-r--r-- 1.3 KB
Fixcprt.py -rwxr-xr-x 1.6 KB
HISTORY -rw-r--r-- 120.9 KB
HPUX-NOTES -rw-r--r-- 1.0 KB
HYPE -rw-r--r-- 3.1 KB
Makefile -rw-r--r-- 242 bytes
Makefile.pre.in -rw-r--r-- 9.6 KB
NEWS -rw-r--r-- 69.2 KB
NEXT-NOTES -rw-r--r-- 2.2 KB
PURIFY.README -rw-r--r-- 3.6 KB
README -rw-r--r-- 1.6 KB
RENAME -rw-r--r-- 10.9 KB
RFD -rw-r--r-- 3.9 KB
ccpy-style.el -rw-r--r-- 1.3 KB
cheatsheet -rw-r--r-- 21.8 KB
comparisons -rw-r--r-- 6.6 KB
editline-fix -rw-r--r-- 2.4 KB
faq2html.py -rwxr-xr-x 6.6 KB
fixfuncptrs.sh -rwxr-xr-x 2.2 KB
gMakefile -rw-r--r-- 2.2 KB
indent.pro -rw-r--r-- 66 bytes
python-mode.el -rw-r--r-- 100.6 KB
python.gif -rw-r--r-- 7.2 KB
python.man -rw-r--r-- 7.7 KB
renumber.py -rwxr-xr-x 2.6 KB
setuid-prog.c -rw-r--r-- 5.3 KB
vgrindefs -rw-r--r-- 498 bytes

README

back to top