[PEAK] dispatch Problem?

Phillip J. Eby pje at telecommunity.com
Sat Jan 22 13:57:14 EST 2005


At 11:47 PM 1/21/05 -0500, Phillip J. Eby wrote:
>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"

Okay, I've found and fixed the problem in CVS, with tests.  It had nothing 
to do with decorators; it was a problem with preserving the order of 
expressions in signatures, that was breaking the generic function used to 
process bare expressions like 'x.bar'.  I wasn't able to reproduce your 
specific problem on Windows for some reason, but I was able to reproduce it 
on Linux with either Python 2.3 or 2.4.  It was a hash-dependent issue, 
i.e. depending on the hash values it would either work or not work, so that 
might have something to do with why I couldn't reproduce on Windows.

Anyway, it's fixed; thanks for the report.




More information about the PEAK mailing list