What is the most idiomatic way to do the following?
def xstr(s): if s is None: return \'\' else: return s s = xstr(a) + xstr(b)
I use max function:
max(None, '') #Returns blank max("Hello",'') #Returns Hello
Works like a charm ;) Just put your string in the first parameter of the function.