How can I do the following in Python?
row = [unicode(x.strip()) for x in row if x is not None else \'\']
Essentially:
One way:
def change(f): if f is None: return unicode(f.strip()) else: return '' row = [change(x) for x in row]
Although then you have:
row = map(change, row)
Or you can use a lambda inline.