[PEAK] dispatch Problem?

Phillip J. Eby pje at telecommunity.com
Fri Jan 21 23:47:53 EST 2005

At 10:14 AM 1/21/05 -0500, Jay Parlar wrote:
>Am I doing something wrong here, or is this a bug in the dispatch module?
>Essentially, I want to check if an object attribute is evaluating to
>True or not, ie.
> >>> import dispatch
> >>> @dispatch.generic()
>... def foo(x): pass
> >>> @foo.when("x.bar")
>... def foo(x): print "x.bar is some sort of true"

Hm, I can't reproduce this with Python 2.3, so I'm guessing it's something 
in my "forward compatibility" code for decorators.  Hm.  Try this.  In the 
'protocols.advice' module, comment out line 312 (the 'frame = 
sys._getframe(1)' line).  I have a suspicion that maybe that  line has 
something to do with it.  If that doesn't fix it, I'll have to build a 2.4 
Python somewhere to play with.

Does the test suite run?  (i.e. 'python setup.py -q test')

More information about the PEAK mailing list