def __eq__(self, other):
        return (isinstance(other, self.__class__) and
                other.package == self.package)
def reorder_item(self, item, position):
    new_position = min(max(position, 0), len(self._items) - 1)