So I\'ve got a comprehension to the effect of:
dict((x.key, x.value) for x in y)
The problem, of course, is that if there\'s multiple
Nope. You cannot do this in a comprehension.
But you can use itertools.groupby.
itertools.groupby