def returns_clone(func):
 def inner(self, *args, **kwargs):
  clone = self.clone()
  func(clone, *args, **kwargs)
  return clone
 inner.call_local = func
 return inner

def returns_clone ( func ) : def inner ( self , * args , ** kwargs ) : clone = self . clone ( ) func ( clone , * args , ** kwargs ) return clone inner . call_local = func return inner
method decorator that will "clone" the object before applying the given method .