linkcheck.containers

Special container classes.

Classes

LFUCache([size])

Limited cache which purges least frequently used items.

class linkcheck.containers.LFUCache(size=1000)[source]

Bases: dict

Limited cache which purges least frequently used items.

Initialize internal LFU cache.

get(key, def_val=None)[source]

Update key usage if found and return value, else return default.

items()[source]

Return list of items, not updating usage count.

iteritems()[source]

Return iterator of items, not updating usage count.

itervalues()[source]

Return iterator of values, not updating usage count.

pop()[source]

Remove and return a value.

popitem()[source]

Remove and return an item.

setdefault(key, def_val=None)[source]

Update key usage if found and return value, else set and return default.

shrink()[source]

Shrink ca. 5% of entries.

uses(key)[source]

Get number of uses for given key (without increasing the number of uses)

values()[source]

Return list of values, not updating usage count.