def _split_triples(triples):
    """
    Convert a list of triples into three lists each consists of 1st,
    2nd and 3rd element of each triples.

    The range triples may be doubles (start, stop) or single (stop,),
    but they have to be always tuples.
    """
    starts, stops, steps = [], [], []
    for triple in triples:
        if len(triple) == 3:
            start, stop, step = triple
        elif len(triple) == 2:
            start, stop, step = triple[0], triple[1], 1
        elif len(triple) == 1:
            start, stop, step = 0, triple[0], 1
        else:
            raise TypeError("tuple is longer or shorter than expected 1 to 3")
        starts.append(start)
        stops.append(stop)
        steps.append(step)
    return starts, stops, steps