def __delitem__ ( self , key ) : index , value = self . _dict . pop ( key ) key2 , value2 = self . _list . pop ( index ) assert key == key2 assert value is value2 self . _fix_indices_after_delete ( index )
python delete index from dictionary
Remove item with given key from the mapping .
def __delitem__(self, key):
		"""Remove item with given key from the mapping.

		Runs in O(n), unless removing last item, then in O(1).
		"""
		index, value = self._dict.pop(key)
		key2, value2 = self._list.pop(index)
		assert key == key2
		assert value is value2

		self._fix_indices_after_delete(index)