Example #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])
Example #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])
Example #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])
Example #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])