Skip to content

Instantly share code, notes, and snippets.

@JensRantil
Created October 3, 2013 13:06
Show Gist options
  • Save JensRantil/6809518 to your computer and use it in GitHub Desktop.
Save JensRantil/6809518 to your computer and use it in GitHub Desktop.
Today's favourite code reviewal.
from django.utils.datastructures import SortedDict
dictionary = {}
# populating `dictionary`...
sortedDictionary = SortedDict()
for word in sorted(dictionary.iterkeys()):
sortedDictionary[word] = dictionary[word]
# Yepp, `sortedDictionary` is double sorted!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment