def count_items(self, unique=True):
        """Count items in the cart.

        Parameters
        ----------
        unique : bool-convertible, optional

        Returns
        -------
        int
            If `unique` is truthy, then the result is the number of
            items in the cart. Otherwise, it's the sum of all item
            quantities.

        """
        if unique:
            return len(self.items)
        return sum([item.quantity for item in self.items.values()])