Ticket #7496: datastructures.py.diff

File datastructures.py.diff, 580 bytes (added by John Huddleston <huddlej@…>, 16 years ago)

SortedDict patch

  • django/utils/datastructures.py

     
    5454    """
    5555    A dictionary that keeps its keys in the order in which they're inserted.
    5656    """
     57    def __new__(cls, *args, **kwargs):
     58        instance = super(SortedDict, cls).__new__(cls, *args, **kwargs)
     59        instance.keyOrder = []
     60        return instance
     61
    5762    def __init__(self, data=None):
    5863        if data is None:
    5964            data = {}
Back to Top