list comprehensions and any in python

One reason I like python is the functional aspects to it.

Recently working on my command line email checker imapchkr I wanted to find out if any account object had a new mail count > 0. I had a list of these objects (which are actually namedtuples). This was neatly done with a list comprehension and any:

if any([msg.unread > 0 for msg in counts]):
    # display the messages