Do you think that it is OK to use map for an applying function to arguments list and ignore the results?
map(foo, bar)
It may appears as bug to person who is reading code.
Do you think that it is OK to use map for an applying function to arguments list and ignore the results?
map(foo, bar)
It may appears as bug to person who is reading code.
When you want the result using map is a perfectly fine way to apply a function to each item in a list, although many find it clearer to write it as a list comprehension or generator:
result = [foo(x) for x in bar]
However if you don't intend to use the result of the function call and are interested only in the side-effects then you should write using a procedural style instead:
for x in bar:
foo(x)
This behavior is frowned upon. Use a for loop unless you intend to make use of the returned list.