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])
def test_scanning(self): result = transduce(transducer=scanning(operator.add), reducer=appending(), iterable=range(5)) self.assertListEqual(result, [0, 1, 3, 6, 10])