class LRUCache:
Method | __contains__ |
Check if a key exists in this cache. |
Method | __delitem__ |
Remove an item from the cache dict. Raise a KeyError if it does not exist. |
Method | __getitem__ |
Get an item from the cache. Moves the item up so that it has the highest priority then. |
Method | __getnewargs__ |
Undocumented |
Method | __getstate__ |
Undocumented |
Method | __init__ |
Undocumented |
Method | __iter__ |
Undocumented |
Method | __len__ |
Return the current size of the cache. |
Method | __repr__ |
Undocumented |
Method | __reversed__ |
Iterate over the keys in the cache dict, oldest items coming first. |
Method | __setitem__ |
Sets the value for an item. Moves the item up so that it has the highest priority then. |
Method | __setstate__ |
Undocumented |
Method | _postinit |
Undocumented |
Method | clear |
Clear the cache. |
Method | copy |
Return a shallow copy of the instance. |
Method | get |
Return an item from the cache dict or default |
Method | items |
Return a list of items. |
Method | keys |
Return a list of all keys ordered by most recent usage. |
Method | setdefault |
Set default if the key is not in the cache otherwise leave unchanged. Return the value of this key. |
Method | values |
Return a list of all values. |
Instance Variable | _append |
Undocumented |
Instance Variable | _mapping |
Undocumented |
Instance Variable | _pop |
Undocumented |
Instance Variable | _popleft |
Undocumented |
Instance Variable | _queue |
Undocumented |
Instance Variable | _remove |
Undocumented |
Instance Variable | _wlock |
Undocumented |
Instance Variable | capacity |
Undocumented |
Parameters | |
key:t.Any | Undocumented |
Returns | |
bool | Undocumented |
KeyError
if it does not exist.Parameters | |
key:t.Any | Undocumented |
Get an item from the cache. Moves the item up so that it has the highest priority then.
Raise a KeyError
if it does not exist.
Parameters | |
key:t.Any | Undocumented |
Returns | |
t.Any | Undocumented |
Returns | |
t.Iterator[ | Undocumented |
Parameters | |
key:t.Any | Undocumented |
value:t.Any | Undocumented |
default
Parameters | |
key:t.Any | Undocumented |
default:t.Any | Undocumented |
Returns | |
t.Any | Undocumented |
Returns | |
t.Iterable[ | Undocumented |