And not to start a flame war, but the code:
numbers = [1,10,100,1000,10000]
if [number for number in numbers if number < 10]:
print 'Success'
# Output: 'Success!'
actually does say that it's less efficient... granted it's buried in a paragraph so it's maybe not too obvious ; )... if you're using Genshi or something similar though you need to be able to toss crazy things in one line sometimes.And 'Test is False' doesn't have to evaluate to True... if it is false, it is still the value returned by the entire expression. Not the actual value 'False'. I actually disagree with your example
s = foo and "word: "+foo or ""
I tried it and "" got assigned to s...And dude, the string in substring syntax is awesome!