I have some code in python, that bitwise or-equals b to all the values in an a multidimensional list called a
for i in xrange(len(a)):
for j in xrange(len(a[i])):
a[i][j] |= b
My question is, is there any way to write this code using only (map(), filter(), reduce()) without having to use lambdas or any other function definitions like in the example below
map(lambda x: map(lambda y: y | b, x), a)
I see absolutely no reason why one should ever avoid lambdas or list comprehensions, but here goes: