def fixSlices(slices):
    """A convenience function used by :meth:`selectByValue`,
    :meth:`clearSelection` and :meth:`getIndices`, to sanitise their
    ``restrict`` parameter.
    """
    if slices is None:
        slices = [None, None, None]
    if len(slices) != 3:
        raise ValueError('Three slice objects are required')
    for i, s in enumerate(slices):
        if s is None:
            slices[i] = slice(None)
    return tuple(slices)
