python - How to do an insertion sort of a list of dictionaries by key without using sort BIF's? -


i learning python @ university , have exercise can't figure out. i'm writing own functions understand how sorting dictionary works without using bif sorting. 1 part of large exercise, , need off ground. dictionary in list of dictionaries. have doesn't work, appreciated. oxford list of dictionaries (the dictionaries have lots of data inside)

def myinsertion(oxford, key) :     temp = list() # creating new empty temporary list     key in oxford[:-1] : # looking thru keys in list beginning @ end         temp.append(key) # adding key temp list     j = key     while j < oxford[:-1] :  # comparing j temp key last position key         temp[j] = oxford[j -1] # if true j replaces last position in oxford         j = j - 1    # stop continuous looping