I have a list of objects and I want to change the value of an attribute of all the objects (to the same value-NewValue).
Is map()
more efficient than a normal for loop in this situation where the function(lambda) doesn't return any value?
map ( lambda x: x.attribute = NewValue, li)
vs
for i in li:
i.attribute = NewValue