code: def update_function(old, new):
      
      for name in func_attrs:
          try:
              setattr(old, name, getattr(new, name))
          except (AttributeError, TypeError):
              pass
docs: Upgrade the code object of a function