Is it possible to convert the following to a python list comprehension:
values = [a,b,c,d,...]
converted_values = []
for item in values:
if type(item) == datetime.date:
converted_values.append(item)
else:
converted_values.append(item.decode('utf-8'))
You can use Conditional Expressions to make this work.
Python conditionals are fairly readable. Here’s some examples to show how they work: