def box(type_):
    """Create a non-iterable box type for an object.

    Parameters
    ----------
    type_ : type
        The type to create a box for.

    Returns
    -------
    box : type
        A type to box values of type ``type_``.
    """
    class c(object):
        __slots__ = 'value',

        def __init__(self, value):
            if not isinstance(value, type_):
                raise TypeError(
                    "values must be of type '%s' (received '%s')" % (
                        type_.__name__, type(value).__name__,
                    ),
                )
            self.value = value

    c.__name__ = 'Boxed%s' + type_.__name__
    return c