Code


Version 2 (modified by James Wheare, 7 years ago) (diff)

--

SortedDict

One of Django's custom data structure classes
source:django/trunk/django/utils/datastructures.py

A dictionary that keeps its keys in the order in which they're inserted.

Supports the following extra methods:

insert(index, key, value)
Inserts the key, value pair before the item with the given index."

value_for_index(index)
Returns the value of the item at the given zero-based index.