Return a shallow copy of the instance.
(self)
| 454 | return (self.capacity,) |
| 455 | |
| 456 | def copy(self) -> "LRUCache": |
| 457 | """Return a shallow copy of the instance.""" |
| 458 | rv = self.__class__(self.capacity) |
| 459 | rv._mapping.update(self._mapping) |
| 460 | rv._queue.extend(self._queue) |
| 461 | return rv |
| 462 | |
| 463 | def get(self, key: t.Any, default: t.Any = None) -> t.Any: |
| 464 | """Return an item from the cache dict or `default`""" |