The easiest way would be not to pass bars
through the different functions, but to access it directly from maptest
:
foos = [1.0,2.0,3.0,4.0,5.0]
bars = [1,2,3]
def maptest(foo):
print foo, bars
map(maptest, foos)
With your original maptest
function you could also use a lambda function in map
:
map((lambda foo: maptest(foo, bars)), foos)