Example #1
0
    def test_list(self):

        assert [['4', '6'], [4, 6]] == P.Pipe(
            3,
            [
                P + 1
            ,
                P * 2
            ],
            [
                P._2(map, str)
            ,
                ()
            ]
        )
Example #2
0
 def test_underscores(self):
     assert P._(a2_plus_b_minus_2c, 2, 4)(3) == 3 # (3)^2 + 2 - 2*4
     assert P._2(a2_plus_b_minus_2c, 2, 4)(3) == -1 # (2)^2 + 3 - 2*4
     assert P._3(a2_plus_b_minus_2c, 2, 4)(3) == 2 # (2)^2 + 4 - 2*3