Ticket #6611: sorteddict-copy-7121.diff
File sorteddict-copy-7121.diff, 980 bytes (added by , 17 years ago) |
---|
-
django/utils/datastructures.py
145 145 """Returns a copy of this object.""" 146 146 # This way of initializing the copy means it works for subclasses, too. 147 147 obj = self.__class__(self) 148 obj.keyOrder = self.keyOrder 148 obj.keyOrder = self.keyOrder[:] 149 149 return obj 150 150 151 151 def __repr__(self): -
tests/regressiontests/datastructures/tests.py
77 77 'not one' 78 78 >>> d.keys() == d.copy().keys() 79 79 True 80 >>> d2 = d.copy() 81 >>> d2['four'] = 'four' 80 82 >>> print repr(d) 81 83 {'one': 'not one', 'two': 'two', 'three': 'three'} 82 84 >>> d.pop('one', 'missing')