Skip to content

Instantly share code, notes, and snippets.

@mementum
Created July 22, 2019 22:04
Show Gist options
  • Save mementum/c2f6b3cf45ccd63ba8705f3156be7c9b to your computer and use it in GitHub Desktop.
Save mementum/c2f6b3cf45ccd63ba8705f3156be7c9b to your computer and use it in GitHub Desktop.
def next(self):
# sort data and current rank
ranks = sorted(
self.ranks.items(), # get the (d, rank), pair
key=lambda x: x[1][0], # use rank (elem 1) and current time "0"
reverse=True, # highest ranked 1st ... please
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment