Here is the loop I am trying to use the map
function on:
volume_ids = [1,2,3,4,5]
ip = \'172.12.13.122\'
for volume_id in volume_ids:
my_fun
How about this?
results = []
for volume_id in volume_ids:
results.append(my_function(volume_id, ip=ip))
This is three lines of code instead of one --- it's three lines of clear and obvious code instead of importing some special-case helper from module such-and-such. This argument is probably a matter of taste, but it has a lot of weight depending on who you talk to.