code: def pop(self):
          
          it = iter(self)
          try:
              value = next(it)
          except StopIteration:
              raise KeyError
          self.discard(value)
          return value
docs: Return the popped value.  Raise KeyError if empty.