def _patch_wrapper(old, new):
 try:
  new.__name__ = old.__name__
  new.__module__ = old.__module__
  new.__doc__ = old.__doc__
  new.__dict__ = old.__dict__
 except Exception:
  pass
 return new

def _patch_wrapper ( old , new ) : try : new . __name__ = old . __name__ new . __module__ = old . __module__ new . __doc__ = old . __doc__ new . __dict__ = old . __dict__ except Exception : pass return new
helper function that forwards all the function details to the decorated function .