=== django/utils/datastructures.py
==================================================================
|
|
|
43 | 43 | return True |
44 | 44 | return False |
45 | 45 | |
| 46 | def __str__(self): |
| 47 | ''' |
| 48 | Returns something like |
| 49 | |
| 50 | "{'key1': 'val1', 'key2': 'val2', 'key3': 'val3'}" |
| 51 | |
| 52 | instead of the generic "<object meta-data>" inherited from object. |
| 53 | ''' |
| 54 | return str(dict(self.items())) |
| 55 | |
| 56 | def __repr__(self): |
| 57 | ''' |
| 58 | Returns something like |
| 59 | |
| 60 | MergeDict({'key1': 'val1', 'key2': 'val2'}, {'key3': 'val3'}) |
| 61 | |
| 62 | instead of generic "<object meta-data>" inherited from object. |
| 63 | ''' |
| 64 | dictreprs = ', '.join(repr(d) for d in self.dicts) |
| 65 | return '%s(%s)' % (self.__class__.__name__, dictreprs) |
| 66 | |
46 | 67 | class SortedDict(dict): |
47 | 68 | "A dictionary that keeps its keys in the order in which they're inserted." |
48 | 69 | def __init__(self, data=None): |