Beispiel #1
0
 def __deepcopy__(self, memodict):
     """
     Utility method used by copy.deepcopy().
     """
     obj = Node(connector=self.connector, negated=self.negated)
     obj.__class__ = self.__class__
     obj.children = deepcopy(self.children, memodict)
     obj.subtree_parents = deepcopy(self.subtree_parents, memodict)
     return obj
Beispiel #2
0
 def __deepcopy__(self, memodict):
     """
     Utility method used by copy.deepcopy().
     """
     obj = Node(connector=self.connector, negated=self.negated)
     obj.__class__ = self.__class__
     obj.children = deepcopy(self.children, memodict)
     obj.subtree_parents = deepcopy(self.subtree_parents, memodict)
     return obj
Beispiel #3
0
 def __deepcopy__(self, memo=None):
     import google.appengine._internal.django.utils.copycompat as copy
     if memo is None:
         memo = {}
     result = self.__class__()
     memo[id(self)] = result
     for key, value in dict.items(self):
         dict.__setitem__(result, copy.deepcopy(key, memo),
                          copy.deepcopy(value, memo))
     return result
Beispiel #4
0
 def __deepcopy__(self, memo=None):
     import google.appengine._internal.django.utils.copycompat as copy
     if memo is None:
         memo = {}
     result = self.__class__()
     memo[id(self)] = result
     for key, value in dict.items(self):
         dict.__setitem__(result, copy.deepcopy(key, memo),
                          copy.deepcopy(value, memo))
     return result
Beispiel #5
0
 def __deepcopy__(self, memo):
     if self._wrapped is None:
         # We have to use SimpleLazyObject, not self.__class__, because the
         # latter is proxied.
         result = SimpleLazyObject(self._setupfunc)
         memo[id(self)] = result
         return result
     else:
         # Changed to use deepcopy from copycompat, instead of copy
         # For Python 2.4.
         from google.appengine._internal.django.utils.copycompat import deepcopy
         return deepcopy(self._wrapped, memo)
 def __deepcopy__(self, memo):
     if self._wrapped is None:
         # We have to use SimpleLazyObject, not self.__class__, because the
         # latter is proxied.
         result = SimpleLazyObject(self._setupfunc)
         memo[id(self)] = result
         return result
     else:
         # Changed to use deepcopy from copycompat, instead of copy
         # For Python 2.4.
         from google.appengine._internal.django.utils.copycompat import deepcopy
         return deepcopy(self._wrapped, memo)
Beispiel #7
0
 def __deepcopy__(self, memo):
     return self.__class__([(key, deepcopy(value, memo))
                            for key, value in self.iteritems()])
Beispiel #8
0
 def __deepcopy__(self, memo):
     return self.__class__([(key, deepcopy(value, memo))
                            for key, value in six.iteritems(self)])