Is there a more elegant way for unpacking keys and values of a dictionary into two lists, without losing consistence?

Viewed 51059

What I came up with is:

keys, values = zip(*[(key, value) for (key, value) in my_dict.iteritems()])

But I am not satisfied. What do the pythonistas say?

2 Answers
Related