Using map(numpy.all, range(-2,3)) is actually creating a list with:
[numpy.all(-2), numpy.all(-1), numpy.all(0), numpy.all(1), numpy.all(2)]
giving
[-2, -1, 0, 1, 2]
If you did map(lambda x: numpy.all([x]), range(-2,3)), it would do:
[numpy.all([-2]), numpy.all([-1]), numpy.all([0]), numpy.all([1]), numpy.all([2])]
giving
[True, True, False, True, True]
As posted by @Mark Dickinson, there is a known issue with numpy.all in which it returns the input value instead of True or False for some inputs. In your second example map(numpy.all, [False, True]) does exactly as before, returning the input value.
[True, True, False, True, True], on Python 2.7.3, NumPy 1.6.1. What versions of Python and NumPy are you using?np.all(-2)to return?allon a scalar is an odd enough thing to do that it probably doesn't matter, but apparently zero-dimensional arrays behave this way, too:numpy.all(numpy.ones(()))gives1.0for me on NumPy 1.7.1.