[python] Slice indices must be integers or None or have __index__ method