Ticket #3964: SortedDict__repr__.diff
File SortedDict__repr__.diff, 713 bytes (added by , 18 years ago) |
---|
-
django/utils/datastructures.py
99 99 obj.keyOrder = self.keyOrder 100 100 return obj 101 101 102 def __repr__(self): 103 '''Returns string representation of d. The Python default for dicts 104 doesn't seem to use keys(). We just re-implement it as an iterator 105 over self so that the representation appears to have the correct order. 106 ''' 107 return '{%s}' % ', '.join( 108 '%s: %s' % (repr(k), repr(self[k])) for k in self) 109 102 110 class MultiValueDictKeyError(KeyError): 103 111 pass 104 112