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

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

        map1_n = lambda f,n: map(f, range(1,n+1))
        


src/l/i/list115utils-1.0.1/list115utils/test/test_listutils.py   list115utils(Download)
        self.assertEqual(map0_n(f_dbl, 0), [])
 
from list115utils import map1_n
class TestMap1n(TestListUtils):
    def test_map1_n_can_shift(self):
        self.assertEqual(map1_n(f_inc, 5), [2,3,4,5,6])
 
    def test_map1_n_can_double(self):
        self.assertEqual(map1_n(f_dbl, 5), [2,4,6,8,10])
    def test_map1_n_works_with_zero(self):
        self.assertEqual(map1_n(f_dbl, 0), [])
 
from list115utils import empty_lists
class TestEmptyLists(TestListUtils):