Return the popped value. Raise KeyError if empty.
(self)
| 718 | self.discard(value) |
| 719 | |
| 720 | def pop(self): |
| 721 | """Return the popped value. Raise KeyError if empty.""" |
| 722 | it = iter(self) |
| 723 | try: |
| 724 | value = next(it) |
| 725 | except StopIteration: |
| 726 | raise KeyError from None |
| 727 | self.discard(value) |
| 728 | return value |
| 729 | |
| 730 | def clear(self): |
| 731 | """This is slow (creates N new iterators!) but effective.""" |
no test coverage detected