def is_method(func):
    """Detects if the given callable is a method. In context of pytypes this
    function is more reliable than plain inspect.ismethod, e.g. it automatically
    bypasses wrappers from typechecked and override decorators.
    """
    func0 = _actualfunc(func)
    argNames = getargnames(getargspecs(func0))
    if len(argNames) > 0:
        if argNames[0] == 'self':
            if inspect.ismethod(func):
                return True
            elif sys.version_info.major >= 3:
                # In Python3 there are no unbound methods, so we count as method,
                # if first arg is called 'self' 
                return True
            else:
                _warn_argname('is_method encountered non-method declaring self',
                        func0, False, False, None)
        else:
            return inspect.ismethod(func)
    return False
def is_method ( func ) : func0 = _actualfunc ( func ) argNames = getargnames ( getargspecs ( func0 ) ) if len ( argNames ) > 0 : if argNames [ 0 ] == 'self' : if inspect . ismethod ( func ) : return True elif sys . version_info . major >= 3 : return True else : _warn_argname ( 'is_method encountered non-method declaring self' , func0 , False , False , None ) else : return inspect . ismethod ( func ) return False
Detects if the given callable is a method. In context of pytypes this
    function is more reliable than plain inspect.ismethod, e.g. it automatically
    bypasses wrappers from typechecked and override decorators.