/usr/share/doc/python-pydispatch-doc/weakref.html is in python-pydispatch-doc 2.0.5-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module weakref</title>
<meta charset="utf-8">
</head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>weakref</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/usr/lib/python2.7/weakref.py">/usr/lib/python2.7/weakref.py</a></font></td></tr></table>
<p><tt>Weak reference support for Python.<br>
<br>
This module is an implementation of <a href="http://www.python.org/dev/peps/pep-0205/">PEP 205</a>:<br>
<br>
<a href="http://www.python.org/dev/peps/pep-0205/">http://www.python.org/dev/peps/pep-0205/</a></tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom> <br>
<font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="UserDict.html">UserDict</a><br>
</td><td width="25%" valign=top></td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="UserDict.html#UserDict">UserDict</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="weakref.html#WeakKeyDictionary">WeakKeyDictionary</a>
</font></dt><dt><font face="helvetica, arial"><a href="weakref.html#WeakValueDictionary">WeakValueDictionary</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial">__builtin__.weakref(<a href="__builtin__.html#object">object</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="weakref.html#KeyedRef">KeyedRef</a>
</font></dt></dl>
</dd>
</dl>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="KeyedRef">class <strong>KeyedRef</strong></a>(__builtin__.weakref)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Specialized reference that includes a key corresponding to the value.<br>
<br>
This is used in the <a href="#WeakValueDictionary">WeakValueDictionary</a> to avoid having to create<br>
a function object for each key stored in the mapping. A shared<br>
callback object can use the 'key' attribute of a <a href="#KeyedRef">KeyedRef</a> instead<br>
of getting a reference to the key from an enclosing scope.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="weakref.html#KeyedRef">KeyedRef</a></dd>
<dd>__builtin__.weakref</dd>
<dd><a href="__builtin__.html#object">object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="KeyedRef-__init__"><strong>__init__</strong></a>(self, ob, callback, key)</dt></dl>
<hr>
Static methods defined here:<br>
<dl><dt><a name="KeyedRef-__new__"><strong>__new__</strong></a>(type, ob, callback, key)</dt></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>key</strong></dt>
</dl>
<hr>
Methods inherited from __builtin__.weakref:<br>
<dl><dt><a name="KeyedRef-__call__"><strong>__call__</strong></a>(...)</dt><dd><tt>x.<a href="#KeyedRef-__call__">__call__</a>(...) <==> x(...)</tt></dd></dl>
<dl><dt><a name="KeyedRef-__eq__"><strong>__eq__</strong></a>(...)</dt><dd><tt>x.<a href="#KeyedRef-__eq__">__eq__</a>(y) <==> x==y</tt></dd></dl>
<dl><dt><a name="KeyedRef-__ge__"><strong>__ge__</strong></a>(...)</dt><dd><tt>x.<a href="#KeyedRef-__ge__">__ge__</a>(y) <==> x>=y</tt></dd></dl>
<dl><dt><a name="KeyedRef-__gt__"><strong>__gt__</strong></a>(...)</dt><dd><tt>x.<a href="#KeyedRef-__gt__">__gt__</a>(y) <==> x>y</tt></dd></dl>
<dl><dt><a name="KeyedRef-__hash__"><strong>__hash__</strong></a>(...)</dt><dd><tt>x.<a href="#KeyedRef-__hash__">__hash__</a>() <==> hash(x)</tt></dd></dl>
<dl><dt><a name="KeyedRef-__le__"><strong>__le__</strong></a>(...)</dt><dd><tt>x.<a href="#KeyedRef-__le__">__le__</a>(y) <==> x<=y</tt></dd></dl>
<dl><dt><a name="KeyedRef-__lt__"><strong>__lt__</strong></a>(...)</dt><dd><tt>x.<a href="#KeyedRef-__lt__">__lt__</a>(y) <==> x<y</tt></dd></dl>
<dl><dt><a name="KeyedRef-__ne__"><strong>__ne__</strong></a>(...)</dt><dd><tt>x.<a href="#KeyedRef-__ne__">__ne__</a>(y) <==> x!=y</tt></dd></dl>
<dl><dt><a name="KeyedRef-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#KeyedRef-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="WeakKeyDictionary">class <strong>WeakKeyDictionary</strong></a>(<a href="UserDict.html#UserDict">UserDict</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Mapping class that references keys weakly.<br>
<br>
Entries in the dictionary will be discarded when there is no<br>
longer a strong reference to the key. This can be used to<br>
associate additional data with an object owned by other parts of<br>
an application without adding attributes to those objects. This<br>
can be especially useful with objects that override attribute<br>
accesses.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="WeakKeyDictionary-__contains__"><strong>__contains__</strong></a>(self, key)</dt></dl>
<dl><dt><a name="WeakKeyDictionary-__copy__"><strong>__copy__</strong></a> = <a href="#WeakKeyDictionary-copy">copy</a>(self)</dt></dl>
<dl><dt><a name="WeakKeyDictionary-__deepcopy__"><strong>__deepcopy__</strong></a>(self, memo)</dt></dl>
<dl><dt><a name="WeakKeyDictionary-__delitem__"><strong>__delitem__</strong></a>(self, key)</dt></dl>
<dl><dt><a name="WeakKeyDictionary-__getitem__"><strong>__getitem__</strong></a>(self, key)</dt></dl>
<dl><dt><a name="WeakKeyDictionary-__init__"><strong>__init__</strong></a>(self, dict<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="WeakKeyDictionary-__iter__"><strong>__iter__</strong></a> = <a href="#WeakKeyDictionary-iterkeys">iterkeys</a>(self)</dt></dl>
<dl><dt><a name="WeakKeyDictionary-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>
<dl><dt><a name="WeakKeyDictionary-__setitem__"><strong>__setitem__</strong></a>(self, key, value)</dt></dl>
<dl><dt><a name="WeakKeyDictionary-copy"><strong>copy</strong></a>(self)</dt></dl>
<dl><dt><a name="WeakKeyDictionary-get"><strong>get</strong></a>(self, key, default<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="WeakKeyDictionary-has_key"><strong>has_key</strong></a>(self, key)</dt></dl>
<dl><dt><a name="WeakKeyDictionary-items"><strong>items</strong></a>(self)</dt></dl>
<dl><dt><a name="WeakKeyDictionary-iteritems"><strong>iteritems</strong></a>(self)</dt></dl>
<dl><dt><a name="WeakKeyDictionary-iterkeyrefs"><strong>iterkeyrefs</strong></a>(self)</dt><dd><tt>Return an iterator that yields the weak references to the keys.<br>
<br>
The references are not guaranteed to be 'live' at the time<br>
they are used, so the result of calling the references needs<br>
to be checked before being used. This can be used to avoid<br>
creating references that will cause the garbage collector to<br>
keep the keys around longer than needed.</tt></dd></dl>
<dl><dt><a name="WeakKeyDictionary-iterkeys"><strong>iterkeys</strong></a>(self)</dt></dl>
<dl><dt><a name="WeakKeyDictionary-itervalues"><strong>itervalues</strong></a>(self)</dt></dl>
<dl><dt><a name="WeakKeyDictionary-keyrefs"><strong>keyrefs</strong></a>(self)</dt><dd><tt>Return a list of weak references to the keys.<br>
<br>
The references are not guaranteed to be 'live' at the time<br>
they are used, so the result of calling the references needs<br>
to be checked before being used. This can be used to avoid<br>
creating references that will cause the garbage collector to<br>
keep the keys around longer than needed.</tt></dd></dl>
<dl><dt><a name="WeakKeyDictionary-keys"><strong>keys</strong></a>(self)</dt></dl>
<dl><dt><a name="WeakKeyDictionary-pop"><strong>pop</strong></a>(self, key, *args)</dt></dl>
<dl><dt><a name="WeakKeyDictionary-popitem"><strong>popitem</strong></a>(self)</dt></dl>
<dl><dt><a name="WeakKeyDictionary-setdefault"><strong>setdefault</strong></a>(self, key, default<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="WeakKeyDictionary-update"><strong>update</strong></a>(self, dict<font color="#909090">=None</font>, **kwargs)</dt></dl>
<hr>
Methods inherited from <a href="UserDict.html#UserDict">UserDict</a>:<br>
<dl><dt><a name="WeakKeyDictionary-__cmp__"><strong>__cmp__</strong></a>(self, dict)</dt></dl>
<dl><dt><a name="WeakKeyDictionary-__len__"><strong>__len__</strong></a>(self)</dt></dl>
<dl><dt><a name="WeakKeyDictionary-clear"><strong>clear</strong></a>(self)</dt></dl>
<dl><dt><a name="WeakKeyDictionary-values"><strong>values</strong></a>(self)</dt></dl>
<hr>
Class methods inherited from <a href="UserDict.html#UserDict">UserDict</a>:<br>
<dl><dt><a name="WeakKeyDictionary-fromkeys"><strong>fromkeys</strong></a>(cls, iterable, value<font color="#909090">=None</font>)<font color="#909090"><font face="helvetica, arial"> from __builtin__.classobj</font></font></dt></dl>
<hr>
Data and other attributes inherited from <a href="UserDict.html#UserDict">UserDict</a>:<br>
<dl><dt><strong>__hash__</strong> = None</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="WeakValueDictionary">class <strong>WeakValueDictionary</strong></a>(<a href="UserDict.html#UserDict">UserDict</a>)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>Mapping class that references values weakly.<br>
<br>
Entries in the dictionary will be discarded when no strong<br>
reference to the value exists anymore<br> </tt></td></tr>
<tr><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="WeakValueDictionary-__contains__"><strong>__contains__</strong></a>(self, key)</dt></dl>
<dl><dt><a name="WeakValueDictionary-__copy__"><strong>__copy__</strong></a> = <a href="#WeakValueDictionary-copy">copy</a>(self)</dt></dl>
<dl><dt><a name="WeakValueDictionary-__deepcopy__"><strong>__deepcopy__</strong></a>(self, memo)</dt></dl>
<dl><dt><a name="WeakValueDictionary-__delitem__"><strong>__delitem__</strong></a>(self, key)</dt></dl>
<dl><dt><a name="WeakValueDictionary-__getitem__"><strong>__getitem__</strong></a>(self, key)</dt></dl>
<dl><dt><a name="WeakValueDictionary-__init__"><strong>__init__</strong></a>(self, *args, **kw)</dt></dl>
<dl><dt><a name="WeakValueDictionary-__iter__"><strong>__iter__</strong></a> = <a href="#WeakValueDictionary-iterkeys">iterkeys</a>(self)</dt></dl>
<dl><dt><a name="WeakValueDictionary-__repr__"><strong>__repr__</strong></a>(self)</dt></dl>
<dl><dt><a name="WeakValueDictionary-__setitem__"><strong>__setitem__</strong></a>(self, key, value)</dt></dl>
<dl><dt><a name="WeakValueDictionary-clear"><strong>clear</strong></a>(self)</dt></dl>
<dl><dt><a name="WeakValueDictionary-copy"><strong>copy</strong></a>(self)</dt></dl>
<dl><dt><a name="WeakValueDictionary-get"><strong>get</strong></a>(self, key, default<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="WeakValueDictionary-has_key"><strong>has_key</strong></a>(self, key)</dt></dl>
<dl><dt><a name="WeakValueDictionary-items"><strong>items</strong></a>(self)</dt></dl>
<dl><dt><a name="WeakValueDictionary-iteritems"><strong>iteritems</strong></a>(self)</dt></dl>
<dl><dt><a name="WeakValueDictionary-iterkeys"><strong>iterkeys</strong></a>(self)</dt></dl>
<dl><dt><a name="WeakValueDictionary-itervaluerefs"><strong>itervaluerefs</strong></a>(self)</dt><dd><tt>Return an iterator that yields the weak references to the values.<br>
<br>
The references are not guaranteed to be 'live' at the time<br>
they are used, so the result of calling the references needs<br>
to be checked before being used. This can be used to avoid<br>
creating references that will cause the garbage collector to<br>
keep the values around longer than needed.</tt></dd></dl>
<dl><dt><a name="WeakValueDictionary-itervalues"><strong>itervalues</strong></a>(self)</dt></dl>
<dl><dt><a name="WeakValueDictionary-pop"><strong>pop</strong></a>(self, key, *args)</dt></dl>
<dl><dt><a name="WeakValueDictionary-popitem"><strong>popitem</strong></a>(self)</dt></dl>
<dl><dt><a name="WeakValueDictionary-setdefault"><strong>setdefault</strong></a>(self, key, default<font color="#909090">=None</font>)</dt></dl>
<dl><dt><a name="WeakValueDictionary-update"><strong>update</strong></a>(self, dict<font color="#909090">=None</font>, **kwargs)</dt></dl>
<dl><dt><a name="WeakValueDictionary-valuerefs"><strong>valuerefs</strong></a>(self)</dt><dd><tt>Return a list of weak references to the values.<br>
<br>
The references are not guaranteed to be 'live' at the time<br>
they are used, so the result of calling the references needs<br>
to be checked before being used. This can be used to avoid<br>
creating references that will cause the garbage collector to<br>
keep the values around longer than needed.</tt></dd></dl>
<dl><dt><a name="WeakValueDictionary-values"><strong>values</strong></a>(self)</dt></dl>
<hr>
Methods inherited from <a href="UserDict.html#UserDict">UserDict</a>:<br>
<dl><dt><a name="WeakValueDictionary-__cmp__"><strong>__cmp__</strong></a>(self, dict)</dt></dl>
<dl><dt><a name="WeakValueDictionary-__len__"><strong>__len__</strong></a>(self)</dt></dl>
<dl><dt><a name="WeakValueDictionary-keys"><strong>keys</strong></a>(self)</dt></dl>
<hr>
Class methods inherited from <a href="UserDict.html#UserDict">UserDict</a>:<br>
<dl><dt><a name="WeakValueDictionary-fromkeys"><strong>fromkeys</strong></a>(cls, iterable, value<font color="#909090">=None</font>)<font color="#909090"><font face="helvetica, arial"> from __builtin__.classobj</font></font></dt></dl>
<hr>
Data and other attributes inherited from <a href="UserDict.html#UserDict">UserDict</a>:<br>
<dl><dt><strong>__hash__</strong> = None</dl>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
<tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td>
<td width="100%"><dl><dt><a name="-getweakrefcount"><strong>getweakrefcount</strong></a>(...)</dt><dd><tt><a href="#-getweakrefcount">getweakrefcount</a>(object) -- return the number of weak references<br>
to 'object'.</tt></dd></dl>
<dl><dt><a name="-getweakrefs"><strong>getweakrefs</strong></a>(...)</dt><dd><tt><a href="#-getweakrefs">getweakrefs</a>(object) -- return a list of all weak reference objects<br>
that point to 'object'.</tt></dd></dl>
<dl><dt><a name="-proxy"><strong>proxy</strong></a>(...)</dt><dd><tt><a href="#-proxy">proxy</a>(object[, callback]) -- create a proxy object that weakly<br>
references 'object'. 'callback', if given, is called with a<br>
reference to the proxy when 'object' is about to be finalized.</tt></dd></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
<td width="100%"><strong>ProxyTypes</strong> = (<type 'weakproxy'>, <type 'weakcallableproxy'>)<br>
<strong>__all__</strong> = ['ref', 'proxy', 'getweakrefcount', 'getweakrefs', 'WeakKeyDictionary', 'ReferenceError', 'ReferenceType', 'ProxyType', 'CallableProxyType', 'ProxyTypes', 'WeakValueDictionary', 'WeakSet']<br>
<strong>__file__</strong> = '/usr/lib/python2.7/weakref.pyc'<br>
<strong>__name__</strong> = 'weakref'</td></tr></table>
</body></html>
|