Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 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)
Exemplo n.º 6
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)
Exemplo n.º 7
0
 def __deepcopy__(self, memo):
     return self.__class__([(key, deepcopy(value, memo))
                            for key, value in self.iteritems()])
Exemplo n.º 8
0
 def __deepcopy__(self, memo):
     return self.__class__([(key, deepcopy(value, memo))
                            for key, value in six.iteritems(self)])