def slice_len(s):
    """Compute the 'length' of a slice, i.e. stop - start.

    Args:
        s (slice): Slice object.

    Raises:
        ValueError: If `s` has a step other than 1 or None.
        ValueError: If `s` is decreasing.

    """
    if s.step not in (None, 1):
        raise ValueError("Slices may not define a step other than 1 or None.")
    if s.stop < s.start:
        raise ValueError("Slice must not be decreasing.")
    return s.stop - s.start