openpathsampling.netcdfplus.cache.WeakValueCache

class openpathsampling.netcdfplus.cache.WeakValueCache(*args, **kwargs)[source]

Implements a cache that keeps weak references to all elements

__init__(*args, **kwargs)[source]

Methods

__init__(*args, **kwargs)

clear()

copy()

get(k[,d])

get_silent(item[, default])

get value by key if it exists, None else

items()

itervaluerefs()

Return an iterator that yields the weak references to the values.

keys()

pop(k[,d])

If key is not found, d is returned if given, otherwise KeyError is raised.

popitem()

as a 2-tuple; but raise KeyError if D is empty.

setdefault(k[,d])

transfer(old_cache)

Transfer values between caches

update([E, ]**F)

If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v

valuerefs()

Return a list of weak references to the values.

values()

Attributes

count

the number of strong references int : the number of weak references

size

the maximal number of strong references, -1 if infinite int : the maximal number of weak references, -1 if infinite