示例#1
0
 def test_scanning_with_init(self):
     result = transduce(transducer=scanning(operator.add, 3),
                        reducer=appending(),
                        iterable=range(5))
     self.assertListEqual(result, [3, 4, 6, 9, 13])
示例#2
0
 def test_scanning_with_init(self):
     result = transduce(transducer=scanning(operator.add, 3),
                        reducer=appending(),
                        iterable=range(5))
     self.assertListEqual(result, [3, 4, 6, 9, 13])
示例#3
0
 def test_scanning(self):
     result = transduce(transducer=scanning(operator.add),
                        reducer=appending(),
                        iterable=range(5))
     self.assertListEqual(result, [0, 1, 3, 6, 10])
示例#4
0
 def test_scanning(self):
     result = transduce(transducer=scanning(operator.add),
                        reducer=appending(),
                        iterable=range(5))
     self.assertListEqual(result, [0, 1, 3, 6, 10])