def readslicestring(slicestring, lenobject):
    """
    return slice parameters: start, end, step  from string input

    lenobject  is the length of the object to be sliced
    """
    start, end, step = 0, 1, 1
    sl = slicestring.split(':')
    if len(sl) >= 2:
        if sl[0] == '':
            start = 0
        else:
            start = int(sl[0])
        if sl[1] == '':
            end = lenobject
        else:
            end = int(sl[1])
        if len(sl) == 3:
            if sl[2] == '':
                step = 1
            else:
                step = int(sl[2])
                if step <= 0:
                    raise ValueError('negative or null step is not handled')
    return start, end, step
