For the sake of completeness I thought I would add the fact that NumPy's 'all' is different from the built-in 'all'. If for example running Python through Python(x,y), NumPy is loaded automatically (and cannot be unloaded as far as I know), so when trying to run the above code it produces rather unexpected results:
>>> if (all(v == 0 for v in [0,1])):
... print 'this should not happen'
... this should not happen
More information on this is in Stack Overflow question numpy all differing from builtin all. As a solution you can either surround the generator with brackets to produce a list:
>>> all( [v == 0 for v in [0,1]] )
False
Or call the built-in function explicitly:
>>> __builtins__.all(v == 0 for v in [0,1,'2'])
False
I found a way to stop Spyder from importing NumPy per default:
Spyder default module import list