If I have a construct like this:
def foo(): a=None b=None c=None #...loop over a config file or command line options... if a is not None an
Writing a separate answer as I do not know how to format code when added as a comment.
Eternal_N00B's solution is not same as Daniel Roseman's solution. Consider for example:
>>> all(v is not None for v in [False]) True >>> all([False]) False