weakref
index
/usr/local/lib/python2.3/weakref.py

Weak reference support for Python.
 
This module is an implementation of PEP 205:
 
http://python.sourceforge.net/peps/pep-0205.html

 
Classes
       
BaseIter
WeakKeyedItemIterator
WeakKeyedKeyIterator
WeakValuedItemIterator
WeakValuedValueIterator
UserDict.UserDict
WeakKeyDictionary
WeakValueDictionary

 
class BaseIter
     Methods defined here:
__iter__(self)

 
class WeakKeyDictionary(UserDict.UserDict)
    Mapping class that references keys weakly.
 
Entries in the dictionary will be discarded when there is no
longer a strong reference to the key. This can be used to
associate additional data with an object owned by other parts of
an application without adding attributes to those objects. This
can be especially useful with objects that override attribute
accesses.
 
  Methods defined here:
__contains__(self, key)
__delitem__(self, key)
__getitem__(self, key)
__init__(self, dict=None)
__iter__ = iterkeys(self)
__repr__(self)
__setitem__(self, key, value)
copy(self)
get(self, key, default=None)
has_key(self, key)
items(self)
iteritems(self)
iterkeys(self)
itervalues(self)
keys(self)
pop(self, key, *args)
popitem(self)
setdefault(self, key, default)
update(self, dict)

Methods inherited from UserDict.UserDict:
__cmp__(self, dict)
__len__(self)
clear(self)
values(self)

Class methods inherited from UserDict.UserDict:
fromkeys(cls, iterable, value=None) from __builtin__.classobj

 
class WeakKeyedItemIterator(BaseIter)
     Methods defined here:
__init__(self, weakdict)
next(self)

Methods inherited from BaseIter:
__iter__(self)

 
class WeakKeyedKeyIterator(BaseIter)
     Methods defined here:
__init__(self, weakdict)
next(self)

Methods inherited from BaseIter:
__iter__(self)

 
class WeakValueDictionary(UserDict.UserDict)
    Mapping class that references values weakly.
 
Entries in the dictionary will be discarded when no strong
reference to the value exists anymore
 
  Methods defined here:
__getitem__(self, key)
__iter__ = iterkeys(self)
__repr__(self)
__setitem__(self, key, value)
copy(self)
get(self, key, default=None)
items(self)
iteritems(self)
iterkeys(self)
itervalues(self)
pop(self, key, *args)
popitem(self)
setdefault(self, key, default)
update(self, dict)
values(self)

Methods inherited from UserDict.UserDict:
__cmp__(self, dict)
__contains__(self, key)
__delitem__(self, key)
__init__(self, dict=None, **kwargs)
__len__(self)
clear(self)
has_key(self, key)
keys(self)

Class methods inherited from UserDict.UserDict:
fromkeys(cls, iterable, value=None) from __builtin__.classobj

 
class WeakValuedItemIterator(BaseIter)
     Methods defined here:
__init__(self, weakdict)
next(self)

Methods inherited from BaseIter:
__iter__(self)

 
class WeakValuedValueIterator(BaseIter)
     Methods defined here:
__init__(self, weakdict)
next(self)

Methods inherited from BaseIter:
__iter__(self)

 
Functions
       
getweakrefcount(...)
getweakrefcount(object) -- return the number of weak references
to 'object'.
getweakrefs(...)
getweakrefs(object) -- return a list of all weak reference objects
that point to 'object'.
proxy(...)
proxy(object[, callback]) -- create a proxy object that weakly
references 'object'.  'callback', if given, is called with a
reference to the proxy when 'object' is about to be finalized.
ref(...)
ref(object[, callback]) -- create a weak reference to 'object';
when 'object' is finalized, 'callback' will be called and passed
a reference to the weak reference object when 'object' is about
to be finalized.

 
Data
        ProxyTypes = (<type 'weakproxy'>, <type 'weakcallableproxy'>)
__all__ = ['ref', 'proxy', 'getweakrefcount', 'getweakrefs', 'WeakKeyDictionary', 'ReferenceType', 'ProxyType', 'CallableProxyType', 'ProxyTypes', 'WeakValueDictionary']