def deepcopy_bound(name):
 def _deepcopy_method(x, memo):
  return type(x)(x.im_func, copy.deepcopy(x.im_self, memo), x.im_class)
 try:
  pre_dispatch = copy._deepcopy_dispatch
  copy._deepcopy_dispatch[types.MethodType] = _deepcopy_method
  ret = copy.deepcopy(name)
 finally:
  copy._deepcopy_dispatch = pre_dispatch
 return ret

def deepcopy_bound ( name ) : def _deepcopy_method ( x , memo ) : return type ( x ) ( x . im_func , copy . deepcopy ( x . im_self , memo ) , x . im_class ) try : pre_dispatch = copy . _deepcopy_dispatch copy . _deepcopy_dispatch [ types . MethodType ] = _deepcopy_method ret = copy . deepcopy ( name ) finally : copy . _deepcopy_dispatch = pre_dispatch return ret
compatibility helper function to allow copy .