[PEAK] Issues with peak.rules predicates
Phillip J. Eby
pje at telecommunity.com
Sat Feb 9 23:46:33 EST 2008
At 10:57 PM 2/9/2008 -0500, rdmurray at bitdance.com wrote:
>On Sat, 9 Feb 2008 at 18:22, Phillip J. Eby wrote:
>>No. It's probably a bug of some sort. If you can reduce the
>>problem to a short example, I should be able to fix it pretty easily.
>
>I think this should be short enough :)
>
>Given:
>
> >>> from peak.rules import when
> >>> def foo(Y):
> ... print "default"
> >>> @when(foo, "not Y")
> ... def footest(Y):
> ... print "footest"
>
>This fails:
>
> >>> foo(False)
> footest
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.
More information about the PEAK
mailing list