[GRASS-SVN] r57506 - grass/trunk/lib/python/pygrass/modules/interface

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Aug 26 05:25:13 PDT 2013


Author: zarch
Date: 2013-08-26 05:25:13 -0700 (Mon, 26 Aug 2013)
New Revision: 57506

Modified:
   grass/trunk/lib/python/pygrass/modules/interface/typedict.py
Log:
Fix Ticket #2060, deepcopy now works

Modified: grass/trunk/lib/python/pygrass/modules/interface/typedict.py
===================================================================
--- grass/trunk/lib/python/pygrass/modules/interface/typedict.py	2013-08-26 12:09:29 UTC (rev 57505)
+++ grass/trunk/lib/python/pygrass/modules/interface/typedict.py	2013-08-26 12:25:13 UTC (rev 57506)
@@ -4,6 +4,7 @@
 
 @author: pietro
 """
+from copy import deepcopy
 try:
     from collections import OrderedDict
 except ImportError:
@@ -45,6 +46,12 @@
     def __call__(self):
         return [self.__getitem__(obj) for obj in self.__iter__()]
 
+    def __deepcopy__(self, memo):
+        obj = TypeDict(self._type)
+        for k, v in self.iteritems():
+            obj[k] = deepcopy(v)
+        return obj
+
     def used(self):
         key_dict = {}
         for key in self:



More information about the grass-commit mailing list