Example #1
0
 def _create(self,parent = None):
     """
     make lean and mean cause its called a ton
     """
     self.inc()
     new = shallow_clone(self)
     new.set_parent(parent)
     #next 2 lines removed to higher level for speed
     #new._children = []
     #if parent is None: new.symbol_table = {}
     return new
Example #2
0
 def clone(self):
     new = shallow_clone(self)
     if(self.root): new.root = self.root.clone()
     return new
Example #3
0
 def data_clone(self):
     new = shallow_clone(self)
     new.data = map(lambda x: x.clone(),self.data)
     return new
Example #4
0
 def __mul__(self, n):
     new = shallow_clone(self)
     new.data = self.data*n
     new.touch()
     return new
Example #5
0
 def __radd__(self, list):
     new = shallow_clone(self)
     if type(list) == type(self.data): new.data = list + self.data
     else:   new.data = list.data + self.data
     new.touch()
     return new
Example #6
0
 def __getslice__(self, i, j):
     new = shallow_clone(self)
     new.data = self.data[i:j]
     new.touch()
     return new
Example #7
0
 def clone(self):
     """ Makes a shallow copy of the object.
     
     Override if you need more specialized behavior.
     """
     return shallow_clone(self)
Example #8
0
 def clone(self): return shallow_clone(self)
 def __float__(self): return float(self._value)