def _mutuallyExclusiveArguments(argumentPairs):
 def wrapper(wrappee):
  argspec = inspect.getargspec(wrappee)
  @wraps(wrappee)
  def wrapped(*args, **kwargs):
   arguments = _passed(argspec, args, kwargs)
   for (this, that) in argumentPairs:
    if ((this in arguments) and (that in arguments)):
     raise TypeError('nope')
   return wrappee(*args, **kwargs)
  return wrapped
 return wrapper

def _mutuallyExclusiveArguments ( argumentPairs ) : def wrapper ( wrappee ) : argspec = inspect . getargspec ( wrappee ) @ wraps ( wrappee ) def wrapped ( * args , ** kwargs ) : arguments = _passed ( argspec , args , kwargs ) for ( this , that ) in argumentPairs : if ( ( this in arguments ) and ( that in arguments ) ) : raise TypeError ( 'nope' ) return wrappee ( * args , ** kwargs ) return wrapped return wrapper
decorator which causes its decoratee to raise a l{typeerror} if two of the given arguments are passed at the same time .