diff options
Diffstat (limited to 'django/utils/datastructures.py')
| -rw-r--r-- | django/utils/datastructures.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/django/utils/datastructures.py b/django/utils/datastructures.py index 94ab76c483..7b7fa2b0f0 100644 --- a/django/utils/datastructures.py +++ b/django/utils/datastructures.py @@ -92,6 +92,13 @@ class SortedDict(dict): "Returns the value of the item at the given zero-based index." return self[self.keyOrder[index]] + def copy(self): + "Returns a copy of this object." + # This way of initializing the copy means it works for subclasses, too. + obj = self.__class__(self) + obj.keyOrder = self.keyOrder + return obj + class MultiValueDictKeyError(KeyError): pass |
