def __instancecheck__(cls, other):
    """Determine if an instance is of the sliced type and within bounds.

        Args:
            other: The instance to test.

        Returns:
            True if the object is both of the same type as sliced by the
            created class as well as within the bounds defined by the class.
        """
    try:
        return bool(isinstance(other, cls.__type__) and cls(other))
    except ValueError:
        return False
