def change_quantity(self, pk, quantity):
        """Change the quantity of an item.

        Parameters
        ----------
        pk : str or int
            The primary key of the item.
        quantity : int-convertible
            A new quantity.

        Raises
        ------
        ItemNotInCart
        NegativeItemQuantity
        NonConvertibleItemQuantity
        TooLargeItemQuantity
        ZeroItemQuantity

        """
        pk = str(pk)
        try:
            item = self.items[pk]
        except KeyError:
            raise ItemNotInCart(pk=pk)
        item.quantity = quantity
        self.update()