def _describe_type(arg):
    """Describe given argument, including length if it's a tuple.

    The purpose is to prevent nonsensical exception messages such as::

        expected a tuple of length 2, got tuple
        expected a tuple, got tuple

    by turning them into::

        expected a tuple of length 3, got tuple of length 2
    """
    if isinstance(arg, tuple):
        return 'tuple of length %s' % len(arg)
    else:
        return type(arg).__name__
