(callable, argIndex=-1)
return addSignature
Decorator that makes sure that the method has the right signature to be
    used as the selector argument to the specified method.

    Usage::

        @objc.selectorFor(NSApplication.beginSheet_modalForWindow_modalDelegate_didEndSelector_contextInfo_)
        def sheetDidEnd_returnCode_contextInfo_(self, sheet, returnCode, info):
            pass
Decorator that makes sure that the method has the right signature to be
    used as the selector argument to the specified method.
Decorator that makes sure that the method has the right signature to be used as the selector argument to the specified method .
def selectorFor(callable, argIndex=-1):
    """
    Decorator that makes sure that the method has the right signature to be
    used as the selector argument to the specified method.

    Usage::

        @objc.selectorFor(NSApplication.beginSheet_modalForWindow_modalDelegate_didEndSelector_contextInfo_)
        def sheetDidEnd_returnCode_contextInfo_(self, sheet, returnCode, info):
            pass
    """
    if argIndex == -1:
        for arg in callable.__metadata__()['arguments']:
            if arg['type'] == _C_SEL and 'sel_of_type' in arg:
                signature = arg['sel_of_type']
                break
        else:
            raise ValueError("No selector argument with type information")

    else:
        try:
            signature = callable.__metadata__()['arguments'][argIndex]['sel_of_type']
        except (IndexError, KeyError):
            raise ValueError("Not a selector argument with type information")

    def addSignature(function):
        return selector(function, signature=signature)

    return addSignature
def selectorFor ( callable , argIndex = - 1 ) : if argIndex == - 1 : for arg in callable . __metadata__ ( ) [ 'arguments' ] : if arg [ 'type' ] == _C_SEL and 'sel_of_type' in arg : signature = arg [ 'sel_of_type' ] break else : raise ValueError ( "No selector argument with type information" ) else : try : signature = callable . __metadata__ ( ) [ 'arguments' ] [ argIndex ] [ 'sel_of_type' ] except ( IndexError , KeyError ) : raise ValueError ( "Not a selector argument with type information" ) def addSignature ( function ) : return selector ( function , signature = signature ) return addSignature