def __init__(self, *args, **kwargs):
        """Initialize with the keyword, callable, and relevant arguments"""

        # Don't want named arguments anywhere in this initializer, since
        #  that would constrain the keywords allowable for calls to the
        #  fetching callable. 'kw' and 'c' probably aren't all that common,
        #  but better to make it more robust/flexible, especially since
        #  the fix is pretty simple.

        # Convert args to a list
        args = list(args)

        # Retrieve the keyword id and the callable
        try:
            kw = args.pop(0)
        except IndexError as e:
            raise TypeError("'Target keyword' argument absent") from e

        try:
            c = args.pop(0)
        except IndexError as e:
            raise TypeError("'Callable' argument absent") from e

        # Proof and store all of the things
        if not self.ok_kwarg(kw):
            raise ValueError("'kw' argument must be a valid non-keyword "
                             "identifier")
        self.kw = kw

        if not callable(c):
            raise TypeError("'c' argument must be callable")
        self.c = c

        if not all(map(self.ok_argarg, args)):
            raise ValueError("All 'args' must be valid non-keyword "
                             "identifier strings or integers")
        if not all(map(self.ok_argarg, kwargs.values())):
            raise ValueError("All 'kwargs' values must be valid non-keyword "
                             "identifier strings or integers")
        self.arglist = args
        self.kwarglist = kwargs
def __init__ ( self , * args , ** kwargs ) : args = list ( args ) try : kw = args . pop ( 0 ) except IndexError as e : raise TypeError ( "'Target keyword' argument absent" ) from e try : c = args . pop ( 0 ) except IndexError as e : raise TypeError ( "'Callable' argument absent" ) from e if not self . ok_kwarg ( kw ) : raise ValueError ( "'kw' argument must be a valid non-keyword " "identifier" ) self . kw = kw if not callable ( c ) : raise TypeError ( "'c' argument must be callable" ) self . c = c if not all ( map ( self . ok_argarg , args ) ) : raise ValueError ( "All 'args' must be valid non-keyword " "identifier strings or integers" ) if not all ( map ( self . ok_argarg , kwargs . values ( ) ) ) : raise ValueError ( "All 'kwargs' values must be valid non-keyword " "identifier strings or integers" ) self . arglist = args self . kwarglist = kwargs
Initialize with the keyword, callable, and relevant arguments