summaryrefslogtreecommitdiff
path: root/django/utils/datastructures.py
diff options
context:
space:
mode:
authorJustin Bronn <jbronn@gmail.com>2008-02-28 21:24:51 +0000
committerJustin Bronn <jbronn@gmail.com>2008-02-28 21:24:51 +0000
commit22e016ff6c18a35a450519b94de63033f83e6b4f (patch)
tree1e58cc40a636b4e4f3dcf429a5a116c015c36278 /django/utils/datastructures.py
parent0b52413cc926446f238fd781b4def6804f64d231 (diff)
gis: Merged revisions 7105-7168 via svnmerge from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@7176 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/utils/datastructures.py')
-rw-r--r--django/utils/datastructures.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/django/utils/datastructures.py b/django/utils/datastructures.py
index 82d914000f..4c278c0d8e 100644
--- a/django/utils/datastructures.py
+++ b/django/utils/datastructures.py
@@ -3,7 +3,7 @@ class MergeDict(object):
A simple class for creating new "virtual" dictionaries that actually look
up values in more than one dictionary, passed in the constructor.
- If a key appears in more than one of the passed in dictionaries, only the
+ If a key appears in more than one of the given dictionaries, only the
first occurrence will be used.
"""
def __init__(self, *dicts):
@@ -145,7 +145,7 @@ class SortedDict(dict):
"""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
+ obj.keyOrder = self.keyOrder[:]
return obj
def __repr__(self):
@@ -155,6 +155,10 @@ class SortedDict(dict):
"""
return '{%s}' % ', '.join(['%r: %r' % (k, v) for k, v in self.items()])
+ def clear(self):
+ super(SortedDict, self).clear()
+ self.keyOrder = []
+
class MultiValueDictKeyError(KeyError):
pass