def _positional(max_pos_args):
 def positional_decorator(wrapped):
  @functools.wraps(wrapped)
  def positional_wrapper(*args, **kwds):
   if (len(args) > max_pos_args):
    plural_s = ''
    if (max_pos_args != 1):
     plural_s = 's'
    raise TypeError(('%s() takes at most %d positional argument%s (%d given)' % (wrapped.__name__, max_pos_args, plural_s, len(args))))
   return wrapped(*args, **kwds)
  return positional_wrapper
 return positional_decorator

def _positional ( max_pos_args ) : def positional_decorator ( wrapped ) : @ functools . wraps ( wrapped ) def positional_wrapper ( * args , ** kwds ) : if ( len ( args ) > max_pos_args ) : plural_s = '' if ( max_pos_args != 1 ) : plural_s = 's' raise TypeError ( ( '%s() takes at most %d positional argument%s (%d given)' % ( wrapped . __name__ , max_pos_args , plural_s , len ( args ) ) ) ) return wrapped ( * args , ** kwds ) return positional_wrapper return positional_decorator
a decorator to declare that only the first n arguments may be positional .