Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(3)  |  Call(2)  |  Derive(0)  |  Import(1)

        foldr = lambda f,i,s: reduce(f, s, i)
        


src/l/i/list115utils-1.0.1/list115utils/test/test_listutils.py   list115utils(Download)
        self.assertEqual(remove_if(p_odd, []), [])
 
from list115utils import foldr
class TestFoldr(TestListUtils):
    def test_foldr_can_do_addition(self):
        self.assertEqual(foldr(add, 1, self.simple_list), 22)
 
    def test_fold_works_on_empty_list(self):
        self.assertEqual(foldr(add, 2, []), 2)