Logged In: YES
user_id=6380
I'm not sure it's that simple. While pickling a C instance
indeed succeed, unpickling it raises a strange exception:
>>> pickle.loads(pickle.dumps(C()))
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/home/guido/trunk/Lib/pickle.py", line 982, in loads
return Unpickler(file).load()
File "/home/guido/trunk/Lib/pickle.py", line 593, in load
dispatch[key](self)
File "/home/guido/trunk/Lib/pickle.py", line 842, in
load_reduce
value = callable.__basicnew__()
AttributeError: type object 'C' has no attribute
'__basicnew__'
>>>
It appears that an argument tuple of None signals some
special Jim-Fulton-only behavior. __basicnew__ is a feature
of ExtensionClasses (similar to __new__ in Python 2.2), and
while ExtensionClasses work in 2.2, they're being
deprecated: Zope 2.x will continue to use Python 2.1.x, and
Zope 3 will require Python 2.2 or higher.
The copy module has never worked for ExtensionClass
instances (unless maybe the class defines a __copy__
method).
Maybe the right thing to do is to document 'None' as a
special case that one shouldn't use, and deprecate
__basicnew__?
(Hm, OTOH why don't I just approve your fix so we can stop
thinking about this. :-)
|