[PEAK] Issues with peak.rules predicates

Phillip J. Eby pje at telecommunity.com
Sun Feb 10 11:36:57 EST 2008


At 11:07 AM 2/10/2008 -0500, rdmurray at bitdance.com wrote:
>On Sat, 9 Feb 2008 at 23:46, Phillip J. Eby wrote:
>>Excellent catch.  The problem was that rules of the form 'not X' 
>>were being treated as having no disjuncts.  Tests added and bug fixed in SVN.
>
>Thanks.  Here's a fun one:
>
>     >>> from peak.rules import when
>
>     >>> def foo(X, Y):
>     ...     print "default"
>
>     >>> @when(foo, "X is None and not Y")
>     ... def footest(X, Y):
>     ...     print "footest"
>
>     >>> @when(foo, "X is None and Y")
>     ... def footest2(X, Y):
>     ...     print "footest2"

Yech.  There was an assumption embedded in Signature that the 
disjuncts of a Test's criterion would be the same as the disjuncts of 
the Test itself.  So, this is actually the same bug in a different 
place.  Test added and bug fixed in SVN.




More information about the PEAK mailing list