def CheckInputArgs(*interfaces):
l = len(interfaces)<EOL>def wrapper(func):<EOL><INDENT>def check_args(self, *args, **kw):<EOL><INDENT>for i in range(len(args)):<EOL><INDENT>if (l > i and interfaces[i].providedBy(args[i])) or interfaces[-<NUM_LIT:1>].providedBy(args[i]):<EOL><INDENT>continue<EOL><DEDENT>if l > i: raise TypeError('<STR_LIT>' %(args[i], interfaces[i]))<EOL>raise TypeError('<STR_LIT>' %(args[i], interfaces[-<NUM_LIT:1>]))<EOL><DEDENT>func(self, *args, **kw)<EOL><DEDENT>return check_args<EOL><DEDENT>return wrapper<EOL>
Must provide at least one interface, the last one may be repeated.