Remove an item from the cache dict. Raise a `KeyError` if it does not exist.
(self, key)
| 427 | self._wlock.release() |
| 428 | |
| 429 | def __delitem__(self, key): |
| 430 | """Remove an item from the cache dict. |
| 431 | Raise a `KeyError` if it does not exist. |
| 432 | """ |
| 433 | self._wlock.acquire() |
| 434 | try: |
| 435 | del self._mapping[key] |
| 436 | try: |
| 437 | self._remove(key) |
| 438 | except ValueError: |
| 439 | # __getitem__ is not locked, it might happen |
| 440 | pass |
| 441 | finally: |
| 442 | self._wlock.release() |
| 443 | |
| 444 | def items(self): |
| 445 | """Return a list of items.""" |