(self, index, key, value)
Insert the key, value pair before the item with the given index.
Insert the key, value pair before the item with the given index.
Insert the key value pair before the item with the given index .
def insert(self, index, key, value):
        """Insert the key, value pair before the item with the given index."""
        if key in self.keyOrder:
            n = self.keyOrder.index(key)
            del self.keyOrder[n]
            if n < index:
                index -= 1
        self.keyOrder.insert(index, key)
        super(OrderedDict, self).__setitem__(key, value)
def insert ( self , index , key , value ) : if key in self . keyOrder : n = self . keyOrder . index ( key ) del self . keyOrder [ n ] if n < index : index -= 1 self . keyOrder . insert ( index , key ) super ( OrderedDict , self ) . __setitem__ ( key , value )