def delslice(model, start, end):
 if isinstance(model, PyListModel):
  del model[start:end]
 elif isinstance(model, QAbstractItemModel):
  model.removeRows(start, (end - start))
 else:
  raise TypeError(type(model))

def delslice ( model , start , end ) : if isinstance ( model , PyListModel ) : del model [ start : end ] elif isinstance ( model , QAbstractItemModel ) : model . removeRows ( start , ( end - start ) ) else : raise TypeError ( type ( model ) )
delete the start .