OpenQuizz
Une application de gestion des contenus pédagogiques
|
Public Member Functions | |
def | __init__ (self, capacity) |
def | __getstate__ (self) |
def | __setstate__ (self, d) |
def | __getnewargs__ (self) |
def | copy (self) |
def | get (self, key, default=None) |
def | setdefault (self, key, default=None) |
def | clear (self) |
def | __contains__ (self, key) |
def | __len__ (self) |
def | __repr__ (self) |
def | __getitem__ (self, key) |
def | __setitem__ (self, key, value) |
def | __delitem__ (self, key) |
def | items (self) |
def | iteritems (self) |
def | values (self) |
def | itervalue (self) |
def | itervalues (self) |
def | keys (self) |
def | iterkeys (self) |
def | __iter__ (self) |
def | __reversed__ (self) |
Data Fields | |
capacity | |
A simple LRU Cache implementation.
def __init__ | ( | self, | |
capacity | |||
) |
def __contains__ | ( | self, | |
key | |||
) |
Check if a key exists in this cache.
def __delitem__ | ( | self, | |
key | |||
) |
Remove an item from the cache dict. Raise a `KeyError` if it does not exist.
def __getitem__ | ( | self, | |
key | |||
) |
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.
def __getnewargs__ | ( | self | ) |
def __getstate__ | ( | self | ) |
def __iter__ | ( | self | ) |
def __len__ | ( | self | ) |
Return the current size of the cache.
def __repr__ | ( | self | ) |
def __reversed__ | ( | self | ) |
Iterate over the keys in the cache dict, oldest items coming first.
def __setitem__ | ( | self, | |
key, | |||
value | |||
) |
Sets the value for an item. Moves the item up so that it has the highest priority then.
def __setstate__ | ( | self, | |
d | |||
) |
def clear | ( | self | ) |
Clear the cache.
def copy | ( | self | ) |
Return a shallow copy of the instance.
def get | ( | self, | |
key, | |||
default = None |
|||
) |
Return an item from the cache dict or `default`
def items | ( | self | ) |
Return a list of items.
def iteritems | ( | self | ) |
Iterate over all items.
def iterkeys | ( | self | ) |
Iterate over all keys in the cache dict, ordered by the most recent usage.
def itervalue | ( | self | ) |
Iterate over all values.
def itervalues | ( | self | ) |
Iterate over all values.
def keys | ( | self | ) |
Return a list of all keys ordered by most recent usage.
def setdefault | ( | self, | |
key, | |||
default = None |
|||
) |
Set `default` if the key is not in the cache otherwise leave unchanged. Return the value of this key.
def values | ( | self | ) |
Return a list of all values.
capacity |