This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tovrstra
Recipients
Date 2004-02-08.15:55:57
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
My python version:

Python 2.3.3 (#1, Jan 25 2004, 21:45:01)
[GCC 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r3,
propolice)] on linux2

Please try the example. That will explain a lot. The
problem is that not all new style class instances are
picklable. In my example a class is derived from a list
and a base class. The list-descendant contains an
instance of the base class, which has a reference to
the list containing it. with cPickle things work fine,
but not for the normal pickle routines

class subitem:
	def __init__(self, parent):
		self.parent = parent
		if parent != None:
			parent.append(self)

class group(subitem, list):
	def __init__(self, parent):
		subitem.__init__(self, parent)
		

g = group(None)
s = subitem(g)

import cPickle
print cPickle.dumps(g)

import pickle
print pickle.dumps(g)
History
Date User Action Args
2007-08-23 14:19:48adminlinkissue892902 messages
2007-08-23 14:19:48admincreate