Пример #1
0
 def __imul__(self, other):
     self.trip_set()
     if self.value is None or not isinstance(other, int):
         # generate appropriate error
         self.value *= other
     if other <= 0:
         self.value = []
     else:
         currentvalue = base_clone(self.value)
         for dummy in xrange(1, other):
             self.extend(currentvalue)
     return self
Пример #2
0
    def clone(self, clean_break=False):
        """Create a clone of this field.

        Set ``clean_break`` to ``True`` in order to dissociate the
        copy from the gob instance with which the original is
        associated.
        """
        ret = base_clone(self)
        ret.immutable = False
        if clean_break:
            ret.instance = None
            ret.modifiable = True
        return ret