コード例 #1
0
def test_ProductOrder():
    P = ProductOrder((grlex, lambda m: m[:2]), (grlex, lambda m: m[2:]))
    assert P((1, 3, 3, 4, 5)) > P((2, 1, 5, 5, 5))
    assert str(P) == "ProductOrder(grlex, grlex)"
    assert P.is_global is True
    assert ProductOrder((grlex, None), (ilex, None)).is_global is None
    assert ProductOrder((igrlex, None), (ilex, None)).is_global is False
コード例 #2
0
 def __init__(self, o1, o2, TOP):
     if TOP:
         ProductOrder.__init__(self, (o2, _subs1), (o1, _subs0))
     else:
         ProductOrder.__init__(self, (o1, _subs0), (o2, _subs1))