code: def getfunc(obj, name=''):
      '''Get the function corresponding to name from obj, not the method.'''
      if name:
          obj = getattr(obj, name)
      return getattr(obj, '__func__', objf getfunc(obj, name=''):
      '''Get the function corresponding to name from obj, not the method.'''
      if name:
          obj = getattr(obj, name)
      return getattr(obj, '__func__', obj)
docs: Get the function corresponding to name from obj, not the method.