[Zope-dev] Better test case for Bug 1783: Persistent __call_method__() interferes with __getstate__

John D. Heintz jheintz@isogen.com
Sat, 20 Jan 2001 11:08:13 -0600


Hello all,

The following is the best test case I have so far for bug 1783.

The behavior of the bug is that no CMethods from Persistent can be 
called indirectly when the __call_method__ hook is present.  This means 
that I can't override any of __getstate__, __setstate__, _p_deactivate.

#!/usr/bin/python
import ZODB
from Persistence import Persistent

class P(Persistent):
def __call_method__(self, meth, methArgs, methKW={}):
return apply(meth, methArgs, methKW)

p = P()

p.__getstate__()

#This throws exception!
Persistent.__getstate__(p)


TypeError: function requires exactly 0 arguments; 1 given


-- 
. . . . . . . . . . . . . . . . . . . . . . . .

John D. Heintz | Senior Engineer

1016 La Posada Dr. | Suite 240 | Austin TX 78752
T 512.633.1198 | jheintz@isogen.com

w w w . d a t a c h a n n e l . c o m