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
Adapt from the following (you could one-liner it if you wanted):
values = (a, b, c, d) not_None = (el for el in values if el is not None) value = next(not_None, None)
This takes the first non None value, or returns None instead.
None