objwatch.utils.weak module

class objwatch.utils.weak._IterationGuard(weakcontainer)[source]

Bases: object

__init__(weakcontainer)[source]
class objwatch.utils.weak.WeakIdRef(key, callback=None)[source]

Bases: ReferenceType

__init__(key, callback=None)[source]
class objwatch.utils.weak.WeakIdKeyDictionary(dict=None, ref_type=<class 'objwatch.utils.weak.WeakIdRef'>)[source]

Bases: MutableMapping

__init__(dict=None, ref_type=<class 'objwatch.utils.weak.WeakIdRef'>)[source]
_commit_removals()[source]
_scrub_removals()[source]
copy()[source]
get(k[, d]) D[k] if k in D, else d.  d defaults to None.[source]
items() a set-like object providing a view on D's items[source]
keys() a set-like object providing a view on D's keys[source]
values() an object providing a view on D's values[source]
keyrefs()[source]

Return a list of weak references to the keys.

The references are not guaranteed to be ‘live’ at the time they are used, so the result of calling the references needs to be checked before being used. This can be used to avoid creating references that will cause the garbage collector to keep the keys around longer than needed.

popitem() (k, v), remove and return some (key, value) pair[source]

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

pop(k[, d]) v, remove specified key and return the corresponding value.[source]

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

setdefault(k[, d]) D.get(k,d), also set D[k]=d if k not in D[source]
update([E, ]**F) None.  Update D from mapping/iterable E and F.[source]

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

_abc_impl = <_abc._abc_data object>