[PEAK] Issues with peak.rules predicates

rdmurray at bitdance.com rdmurray at bitdance.com
Sun Feb 10 11:07:20 EST 2008


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"


--David



More information about the PEAK mailing list