I’ve got dictionary with objects values and string keys:
dict{
'key1': object_1
'key2': object_2
}
And I’d like to convert it into:
dict{
'key1': str(object_1)
'key2': str(object_2)
}
Where str(object_1) is a string representation of object_1. What is the simplest and the most pythonic way of performing this transformation?
or in Python2.7+:
For more complicated dicts (with tuples of objects as values):