Staging
v0.5.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
Makefile.pre.in -rw-r--r-- 6.9 KB
Setup.in -rw-r--r-- 13.5 KB
Setup.thread.in -rw-r--r-- 459 bytes
_cursesmodule.c -rw-r--r-- 39.4 KB
_localemodule.c -rw-r--r-- 8.9 KB
_tkinter.c -rw-r--r-- 34.1 KB
almodule.c -rw-r--r-- 82.7 KB
arraymodule.c -rw-r--r-- 27.2 KB
audioop.c -rw-r--r-- 36.7 KB
binascii.c -rw-r--r-- 22.9 KB
bsddbmodule.c -rw-r--r-- 16.8 KB
cPickle.c -rw-r--r-- 95.8 KB
cStringIO.c -rw-r--r-- 15.6 KB
cdmodule.c -rw-r--r-- 20.2 KB
cgen.py -rw-r--r-- 13.3 KB
cgensupport.c -rw-r--r-- 7.8 KB
cgensupport.h -rw-r--r-- 3.7 KB
clmodule.c -rw-r--r-- 66.8 KB
cmathmodule.c -rw-r--r-- 5.8 KB
config.c.in -rw-r--r-- 2.1 KB
cryptmodule.c -rw-r--r-- 505 bytes
cstubs -rw-r--r-- 33.7 KB
dbmmodule.c -rw-r--r-- 7.5 KB
dlmodule.c -rw-r--r-- 5.8 KB
errnomodule.c -rw-r--r-- 24.1 KB
fcntlmodule.c -rw-r--r-- 6.6 KB
flmodule.c -rw-r--r-- 52.1 KB
fmmodule.c -rw-r--r-- 6.7 KB
fpectlmodule.c -rw-r--r-- 9.2 KB
fpetestmodule.c -rw-r--r-- 5.5 KB
gdbmmodule.c -rw-r--r-- 9.6 KB
getbuildinfo.c -rw-r--r-- 463 bytes
getpath.c -rw-r--r-- 14.5 KB
glmodule.c -rw-r--r-- 156.4 KB
grpmodule.c -rw-r--r-- 3.5 KB
imageop.c -rw-r--r-- 15.7 KB
imgfile.c -rw-r--r-- 12.5 KB
ld_so_aix -rwxr-xr-x 5.8 KB
license.terms -rw-r--r-- 2.2 KB
main.c -rw-r--r-- 7.8 KB
makesetup -rwxr-xr-x 6.1 KB
makexp_aix -rwxr-xr-x 2.9 KB
mathmodule.c -rw-r--r-- 6.0 KB
md5.h -rw-r--r-- 2.7 KB
md5c.c -rw-r--r-- 10.2 KB
md5module.c -rw-r--r-- 4.4 KB
mpzmodule.c -rw-r--r-- 41.2 KB
newmodule.c -rw-r--r-- 5.5 KB
nismodule.c -rw-r--r-- 6.9 KB
operator.c -rw-r--r-- 9.3 KB
parsermodule.c -rw-r--r-- 65.4 KB
pcre-internal.h -rw-r--r-- 11.0 KB
pcre.h -rw-r--r-- 1.8 KB
pcremodule.c -rw-r--r-- 15.8 KB
posixmodule.c -rw-r--r-- 61.6 KB
puremodule.c -rw-r--r-- 30.7 KB
pwdmodule.c -rw-r--r-- 3.3 KB
pypcre.c -rw-r--r-- 128.7 KB
python.c -rw-r--r-- 171 bytes
readline.c -rw-r--r-- 6.3 KB
regexmodule.c -rw-r--r-- 16.4 KB
regexpr.c -rw-r--r-- 45.8 KB
regexpr.h -rw-r--r-- 5.4 KB
reopmodule.c -rw-r--r-- 25.3 KB
resource.c -rw-r--r-- 6.7 KB
rgbimgmodule.c -rw-r--r-- 16.4 KB
rotormodule.c -rw-r--r-- 14.4 KB
selectmodule.c -rw-r--r-- 7.9 KB
sgimodule.c -rw-r--r-- 2.5 KB
signalmodule.c -rw-r--r-- 13.9 KB
socketmodule.c -rw-r--r-- 43.2 KB
soundex.c -rw-r--r-- 4.0 KB
stdwinmodule.c -rw-r--r-- 53.8 KB
stropmodule.c -rw-r--r-- 22.0 KB
structmodule.c -rw-r--r-- 23.4 KB
sunaudiodev.c -rw-r--r-- 11.7 KB
svmodule.c -rw-r--r-- 22.0 KB
syslogmodule.c -rw-r--r-- 5.7 KB
tclNotify.c -rw-r--r-- 25.1 KB
termios.c -rw-r--r-- 5.4 KB
threadmodule.c -rw-r--r-- 8.4 KB
timemodule.c -rw-r--r-- 14.5 KB
timing.h -rw-r--r-- 2.6 KB
timingmodule.c -rw-r--r-- 1.2 KB
tkappinit.c -rw-r--r-- 2.3 KB
xxmodule.c -rw-r--r-- 6.0 KB
yuv.h -rw-r--r-- 4.0 KB
yuvconvert.c -rw-r--r-- 4.4 KB
zlibmodule.c -rw-r--r-- 22.6 KB

back to top