Skip to main content

Cache.peekitem()

The newest entry (or with last=False, the oldest) of any key, without removing it, as

Usage

Source

Cache.peekitem(
    last=True,
    *,
    expire_time=False,
    tag=False,
    retry=False,
)

diskcache’s peekitem. Writes only what get would; expired entries are passed over.

Returns

Any
(key, value), widened with expire_time and tag as for pull().

Raises

KeyError
The cache has no live entry.