summaryrefslogtreecommitdiff
path: root/Lib/pickle.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2006-05-26 19:12:38 +0000
committerGuido van Rossum <guido@python.org>2006-05-26 19:12:38 +0000
commit65810fee5e961af07fb964252b794c67162f98ee (patch)
tree7400532588af74faa31a12c31492839ab2e06c9a /Lib/pickle.py
parent2018831b2b2106499a43b37e49e24f7f14154d35 (diff)
downloadcpython-git-65810fee5e961af07fb964252b794c67162f98ee.tar.gz
SF patch 1495675: Remove types.InstanceType and new.instance
(Collin Winter)
Diffstat (limited to 'Lib/pickle.py')
-rw-r--r--Lib/pickle.py40
1 files changed, 0 insertions, 40 deletions
diff --git a/Lib/pickle.py b/Lib/pickle.py
index 02a1b1d1ae..ccda3e7e26 100644
--- a/Lib/pickle.py
+++ b/Lib/pickle.py
@@ -687,46 +687,6 @@ class Pickler:
write(SETITEM)
# else tmp is empty, and we're done
- def save_inst(self, obj):
- cls = obj.__class__
-
- memo = self.memo
- write = self.write
- save = self.save
-
- if hasattr(obj, '__getinitargs__'):
- args = obj.__getinitargs__()
- len(args) # XXX Assert it's a sequence
- _keep_alive(args, memo)
- else:
- args = ()
-
- write(MARK)
-
- if self.bin:
- save(cls)
- for arg in args:
- save(arg)
- write(OBJ)
- else:
- for arg in args:
- save(arg)
- write(INST + cls.__module__ + '\n' + cls.__name__ + '\n')
-
- self.memoize(obj)
-
- try:
- getstate = obj.__getstate__
- except AttributeError:
- stuff = obj.__dict__
- else:
- stuff = getstate()
- _keep_alive(stuff, memo)
- save(stuff)
- write(BUILD)
-
- dispatch[InstanceType] = save_inst
-
def save_global(self, obj, name=None, pack=struct.pack):
write = self.write
memo = self.memo