I have a list of dicts like this:
[{"x" : 5 , "y" : 7} , {"x" : 4 , "y" : 3} , {"x" : 4 , "y" : 7}]
I want to sort them first in ascending order of x and then in descending order of y so that the result is
[{"x" : 4 , "y" : 7} , {"x" : 4 , "y" : 3} , {"x" : 5 , "y" : 7}]
I can sort both in ascending order by
sorted(a , key=lambda k: (k['x'] , k['y']))
or in descending order by
sorted(a , key=lambda k: (k['x'] , k['y']) , reverse=True)
Is there a good way to sort by x ascending and y descending here?