If you use any(lst) , you see that lst is iterable, which is a list of some elements. If it contains [0, False, '', 0.0, [], {}, None] (all of which have logical values False ), then any(lst) will be False . If lst also contained any of the following [-1, True, "X", 0.00001] (all of which are evaluated before True ), then any(lst) will be True .
In the code you posted, x > 0 for x in lst is another type of iteration called a generator expression . Before generator expressions were added in Python, you would create a list comprehension that looks very similar, but with the surrounding [] 's: [x > 0 for x in lst] . From lst containing [-1, -2, 10, -4, 20] , you get this meaningful list: [False, False, True, False, True] . This internal value will then be passed to the any function, which will return True , since there is at least one True value.
But with a generator expression, Python no longer needs to create this internal list of True(s) and False(s) , the values ββwill be generated as the any function iterates using the generated values ββat that time according to the generator expression. And, since there are any short circuits, it will stop the iteration as soon as it sees the first True value. This would be especially convenient if you created lst using something like lst = range(-1,int(1e9)) (or xrange if you use Python2.x). Despite the fact that this expression will generate more than a billion records, any should only go to the third record when it reaches 1 , which evaluates True for x>0 , and therefore any can return True .
If you created a list comprehension, Python would first have to create a list of a billion elements in memory, and then pass this to any . But with a generator expression , you can have Python built-in functions, such as any and all , exit early as soon as you see True or False .