def mergeFunctionMetadata(f, g):
 try:
  g.__name__ = f.__name__
 except TypeError:
  try:
   merged = new.function(g.func_code, g.func_globals, f.__name__, inspect.getargspec(g)[(-1)], g.func_closure)
  except TypeError:
   pass
 else:
  merged = g
 try:
  merged.__doc__ = f.__doc__
 except (TypeError, AttributeError):
  pass
 try:
  merged.__dict__.update(g.__dict__)
  merged.__dict__.update(f.__dict__)
 except (TypeError, AttributeError):
  pass
 merged.__module__ = f.__module__
 return merged

def mergeFunctionMetadata ( f , g ) : try : g . __name__ = f . __name__ except TypeError : try : merged = new . function ( g . func_code , g . func_globals , f . __name__ , inspect . getargspec ( g ) [ ( - 1 ) ] , g . func_closure ) except TypeError : pass else : merged = g try : merged . __doc__ = f . __doc__ except ( TypeError , AttributeError ) : pass try : merged . __dict__ . update ( g . __dict__ ) merged . __dict__ . update ( f . __dict__ ) except ( TypeError , AttributeError ) : pass merged . __module__ = f . __module__ return merged
overwrite c{g}s name and docstring with values from c{f} .