I have a dict and would like to remove all the keys for which there are empty value strings.
metadata = {u\'Composite:PreviewImage\': u\'(Binary data 101973
An alternative way you can do this, is using dictionary comprehension. This should be compatible with 2.7+
2.7+
result = { key: value for key, value in {"foo": "bar", "lorem": None}.items() if value }