Message19940
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) |
|
Date |
User |
Action |
Args |
2007-08-23 14:19:48 | admin | link | issue892902 messages |
2007-08-23 14:19:48 | admin | create | |
|