def n_tuple(argcount):
    """Return a new function to generate an n-tuple with.

    That works only if the specified arity is met when called.

    >>> vec3 = n_tuple(3)
    >>> coords = vec3(100, 20, 30)

    But this throws an error:
    >>> coords = vec3(10, 20)
    """
    def _tuple(*someargs):
        if len(someargs) != argcount:
            raise ValueError(
                '{}-tuple requires arity of {}, '
                'but arity of {} was passed'.format(
                    argcount,
                    argcount,
                    len(someargs)
                ))
        return tuple(someargs)
    return _tuple