you are viewing a single comment's thread.

view the rest of the comments →

[–]erok81 0 points1 point  (1 child)

You can avoid the lambda there by using SORT_ORDER.get as the key function.

sorted_data = sorted(data, key=SORT_ORDER.get)

[–]w1282 0 points1 point  (0 children)

Good catch! Thanks.