Author: gwilson
Date: 2007-11-11 21:12:47 -0600 (Sun, 11 Nov 2007)
New Revision: 6669
Modified:
django/trunk/django/utils/datastructures.py
Log:
Simplified `SortedDict.__deepcopy__` now that the its constructor can take a
sequence of tuples.
Modified: django/trunk/django/utils/datastructures.py
===================================================================
--- django/trunk/django/utils/datastructures.py 2007-11-11 04:44:20 UTC (rev
6668)
+++ django/trunk/django/utils/datastructures.py 2007-11-12 03:12:47 UTC (rev
6669)
@@ -62,12 +62,10 @@
else:
self.keyOrder = [key for key, value in data]
- def __deepcopy__(self,memo):
+ def __deepcopy__(self, memo):
from copy import deepcopy
- obj = self.__class__()
- for k, v in self.items():
- obj[k] = deepcopy(v, memo)
- return obj
+ return self.__class__([(key, deepcopy(value, memo))
+ for key, value in self.iteritems()])
def __setitem__(self, key, value):
dict.__setitem__(self, key, value)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---