Given a list, is there a way to get the first non-None value? And, if so, what would be the pythonic way to do so?
For example, I have:
a = objA.addr
I think this is the simplest way when dealing with a small set of values (will work in a list comprehension as well):
firstVal = a or b or c or d
Will always return the first non "False" value which works in some cases (given you dont expect any values which could evaluate to false as @GrannyAching points out below)