weakref
index
/usr/local/lib/python2.4/weakref.py
Module Docs

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

 
Modules
       
UserDict

 
Classes
       
UserDict.UserDict
WeakKeyDictionary
WeakValueDictionary
__builtin__.object
__builtin__.weakcallableproxy
__builtin__.weakproxy
__builtin__.weakref
__builtin__.weakref

 
CallableProxyType = class weakcallableproxy(object)
     Methods defined here:
__abs__(...)
x.__abs__() <==> abs(x)
__add__(...)
x.__add__(y) <==> x+y
__and__(...)
x.__and__(y) <==> x&y
__call__(...)
x.__call__(...) <==> x(...)
__cmp__(...)
x.__cmp__(y) <==> cmp(x,y)
__contains__(...)
x.__contains__(y) <==> y in x
__delattr__(...)
x.__delattr__('name') <==> del x.name
__delitem__(...)
x.__delitem__(y) <==> del x[y]
__delslice__(...)
x.__delslice__(i, j) <==> del x[i:j]
 
Use of negative indices is not supported.
__div__(...)
x.__div__(y) <==> x/y
__divmod__(...)
x.__divmod__(y) <==> xdivmod(x, y)y
__float__(...)
x.__float__() <==> float(x)
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__iadd__(...)
x.__iadd__(y) <==> x+y
__iand__(...)
x.__iand__(y) <==> x&y
__idiv__(...)
x.__idiv__(y) <==> x/y
__ilshift__(...)
x.__ilshift__(y) <==> x<<y
__imod__(...)
x.__imod__(y) <==> x%y
__imul__(...)
x.__imul__(y) <==> x*y
__int__(...)
x.__int__() <==> int(x)
__invert__(...)
x.__invert__() <==> ~x
__ior__(...)
x.__ior__(y) <==> x|y
__ipow__(...)
x.__ipow__(y) <==> x**y
__irshift__(...)
x.__irshift__(y) <==> x>>y
__isub__(...)
x.__isub__(y) <==> x-y
__iter__(...)
x.__iter__() <==> iter(x)
__ixor__(...)
x.__ixor__(y) <==> x^y
__len__(...)
x.__len__() <==> len(x)
__long__(...)
x.__long__() <==> long(x)
__lshift__(...)
x.__lshift__(y) <==> x<<y
__mod__(...)
x.__mod__(y) <==> x%y
__mul__(...)
x.__mul__(y) <==> x*y
__neg__(...)
x.__neg__() <==> -x
__nonzero__(...)
x.__nonzero__() <==> x != 0
__or__(...)
x.__or__(y) <==> x|y
__pos__(...)
x.__pos__() <==> +x
__pow__(...)
x.__pow__(y[, z]) <==> pow(x, y[, z])
__radd__(...)
x.__radd__(y) <==> y+x
__rand__(...)
x.__rand__(y) <==> y&x
__rdiv__(...)
x.__rdiv__(y) <==> y/x
__rdivmod__(...)
x.__rdivmod__(y) <==> ydivmod(y, x)x
__repr__(...)
x.__repr__() <==> repr(x)
__rlshift__(...)
x.__rlshift__(y) <==> y<<x
__rmod__(...)
x.__rmod__(y) <==> y%x
__rmul__(...)
x.__rmul__(y) <==> y*x
__ror__(...)
x.__ror__(y) <==> y|x
__rpow__(...)
y.__rpow__(x[, z]) <==> pow(x, y[, z])
__rrshift__(...)
x.__rrshift__(y) <==> y>>x
__rshift__(...)
x.__rshift__(y) <==> x>>y
__rsub__(...)
x.__rsub__(y) <==> y-x
__rxor__(...)
x.__rxor__(y) <==> y^x
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setitem__(...)
x.__setitem__(i, y) <==> x[i]=y
__setslice__(...)
x.__setslice__(i, j, y) <==> x[i:j]=y
 
Use  of negative indices is not supported.
__str__(...)
x.__str__() <==> str(x)
__sub__(...)
x.__sub__(y) <==> x-y
__xor__(...)
x.__xor__(y) <==> x^y
next(...)
x.next() -> the next value, or raise StopIteration

 
ProxyType = class weakproxy(object)
     Methods defined here:
__abs__(...)
x.__abs__() <==> abs(x)
__add__(...)
x.__add__(y) <==> x+y
__and__(...)
x.__and__(y) <==> x&y
__cmp__(...)
x.__cmp__(y) <==> cmp(x,y)
__contains__(...)
x.__contains__(y) <==> y in x
__delattr__(...)
x.__delattr__('name') <==> del x.name
__delitem__(...)
x.__delitem__(y) <==> del x[y]
__delslice__(...)
x.__delslice__(i, j) <==> del x[i:j]
 
Use of negative indices is not supported.
__div__(...)
x.__div__(y) <==> x/y
__divmod__(...)
x.__divmod__(y) <==> xdivmod(x, y)y
__float__(...)
x.__float__() <==> float(x)
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__iadd__(...)
x.__iadd__(y) <==> x+y
__iand__(...)
x.__iand__(y) <==> x&y
__idiv__(...)
x.__idiv__(y) <==> x/y
__ilshift__(...)
x.__ilshift__(y) <==> x<<y
__imod__(...)
x.__imod__(y) <==> x%y
__imul__(...)
x.__imul__(y) <==> x*y
__int__(...)
x.__int__() <==> int(x)
__invert__(...)
x.__invert__() <==> ~x
__ior__(...)
x.__ior__(y) <==> x|y
__ipow__(...)
x.__ipow__(y) <==> x**y
__irshift__(...)
x.__irshift__(y) <==> x>>y
__isub__(...)
x.__isub__(y) <==> x-y
__iter__(...)
x.__iter__() <==> iter(x)
__ixor__(...)
x.__ixor__(y) <==> x^y
__len__(...)
x.__len__() <==> len(x)
__long__(...)
x.__long__() <==> long(x)
__lshift__(...)
x.__lshift__(y) <==> x<<y
__mod__(...)
x.__mod__(y) <==> x%y
__mul__(...)
x.__mul__(y) <==> x*y
__neg__(...)
x.__neg__() <==> -x
__nonzero__(...)
x.__nonzero__() <==> x != 0
__or__(...)
x.__or__(y) <==> x|y
__pos__(...)
x.__pos__() <==> +x
__pow__(...)
x.__pow__(y[, z]) <==> pow(x, y[, z])
__radd__(...)
x.__radd__(y) <==> y+x
__rand__(...)
x.__rand__(y) <==> y&x
__rdiv__(...)
x.__rdiv__(y) <==> y/x
__rdivmod__(...)
x.__rdivmod__(y) <==> ydivmod(y, x)x
__repr__(...)
x.__repr__() <==> repr(x)
__rlshift__(...)
x.__rlshift__(y) <==> y<<x
__rmod__(...)
x.__rmod__(y) <==> y%x
__rmul__(...)
x.__rmul__(y) <==> y*x
__ror__(...)
x.__ror__(y) <==> y|x
__rpow__(...)
y.__rpow__(x[, z]) <==> pow(x, y[, z])
__rrshift__(...)
x.__rrshift__(y) <==> y>>x
__rshift__(...)
x.__rshift__(y) <==> x>>y
__rsub__(...)
x.__rsub__(y) <==> y-x
__rxor__(...)
x.__rxor__(y) <==> y^x
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setitem__(...)
x.__setitem__(i, y) <==> x[i]=y
__setslice__(...)
x.__setslice__(i, j, y) <==> x[i:j]=y
 
Use  of negative indices is not supported.
__str__(...)
x.__str__() <==> str(x)
__sub__(...)
x.__sub__(y) <==> x-y
__xor__(...)
x.__xor__(y) <==> x^y
next(...)
x.next() -> the next value, or raise StopIteration

 
ReferenceType = class weakref(object)
     Methods defined here:
__call__(...)
x.__call__(...) <==> x(...)
__eq__(...)
x.__eq__(y) <==> x==y
__ge__(...)
x.__ge__(y) <==> x>=y
__gt__(...)
x.__gt__(y) <==> x>y
__hash__(...)
x.__hash__() <==> hash(x)
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
__le__(...)
x.__le__(y) <==> x<=y
__lt__(...)
x.__lt__(y) <==> x<y
__ne__(...)
x.__ne__(y) <==> x!=y
__repr__(...)
x.__repr__() <==> repr(x)

Data and other attributes defined here:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

 
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__(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=None)
update(self, dict=None, **kwargs)

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 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:
__contains__(self, key)
__getitem__(self, key)
__init__(self, *args, **kw)
__iter__(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)
pop(self, key, *args)
popitem(self)
setdefault(self, key, default=None)
update(self, dict=None, **kwargs)
values(self)

Methods inherited from UserDict.UserDict:
__cmp__(self, dict)
__delitem__(self, key)
__len__(self)
clear(self)
keys(self)

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

 
ref = class weakref(object)
     Methods defined here:
__call__(...)
x.__call__(...) <==> x(...)
__eq__(...)
x.__eq__(y) <==> x==y
__ge__(...)
x.__ge__(y) <==> x>=y
__gt__(...)
x.__gt__(y) <==> x>y
__hash__(...)
x.__hash__() <==> hash(x)
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
__le__(...)
x.__le__(y) <==> x<=y
__lt__(...)
x.__lt__(y) <==> x<y
__ne__(...)
x.__ne__(y) <==> x!=y
__repr__(...)
x.__repr__() <==> repr(x)

Data and other attributes defined here:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

 
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.

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