code: def _update_function(self, oldfunc, newfunc):
          
          oldfunc.__doc__ = newfunc.__doc__
          oldfunc.__dict__.update(newfunc.__dict__)
  
          try:
              newfunc.__code__
              attr_name = '__code__'
          except AttributeError:
              newfunc.func_code
              attr_name = 'func_code'
  
          old_code = getattr(oldfunc, attr_name)
          new_code = getattr(newfunc, attr_name)
          if not code_objects_equal(old_code, new_code):
              notify_info0('Updated function code:', oldfunc)
              setattr(oldfunc, attr_name, new_code)
              self.found_change = True
  
          try:
              oldfunc.__defaults__ = newfunc.__defaults__
          except AttributeError:
              oldfunc.func_defaults = newfunc.func_defaults
  
          return oldfunc
docs: Update a function object.