[PEAK] PEAK-Rules, problem with comparison?

Alberto Valverde alberto at toscat.net
Fri Jan 25 06:51:02 EST 2008


Hi,

After seeing in the last post in this list that PEAK-Rules now supports
predicate dispatch I couldn't resist to try it out :) I think I might
found a bug with comparison, the following doctest reproduces it:

<doctest>
>>> from peak.rules import when
>>> def add_two(a, b): pass
>>> __ = when(add_two, "a > 5")(lambda a,b: a)
>>> add_two(6,6)
6
>>> add_two(4,6)
>>> add_two(5,6)
</doctest>

As I undersand it, last statement should produce None, however, 5 is
produced instead. This is with a fresh checkout, r2492


Alberto






More information about the PEAK mailing list