def test5(): print ("test 5: custom objects") objects = map(Foo, range(10)) pool = Pool(custom=["Foo"]) print pool.map(fobj, objects)
def test4(): print ("\ntest 4: imap_unordered with 2 arguments") pool = Pool() it = pool.imap_unordered(g, list(range(10)), list(range(20, 30))) print ("->", sum(it))
def test2(): print ("\ntest 2: imap_unordered") pool = Pool() it = pool.imap_unordered(f, list(range(10))) print ("->", sum(it))
def test3(): print ("\ntest 3: map with 2 arguments") pool = Pool() print ("->", sum(pool.map(g, list(range(10)), list(range(20, 30)))))
def test1(): print ("\ntest 1: map") pool = Pool() print ("->", sum(pool.map(f, list(range(10)))))