def _slice_support(the_slice, length):
    """Takes a slice and the length of an object; returns normalized version.

    Specifically, corrects start and end for negative indices.
    """
    start = the_slice.start
    stop = the_slice.stop
    step = the_slice.step or 1
    #fill in missing values for start and end
    if start is None:
        start = 0
    if stop is None:
        stop = length
    #convert end-relative values to start-relative values
    if start < 0:
        start = length - start
    if stop < 0:
        stop = length - stop
    return (start, stop, step)

    #ensure step is not zero, or we never move in the sequence!
    if not step:
        step = 1