@@ -16,17 +16,11 @@ \section{\module{weakref} ---
1616XXX --- need to say more here!
1717
1818Not all objects can be weakly referenced; those objects which do
19- include class instances and dictionaries. Extension types can easily
19+ include class instances, functions written in Python (but not in C),
20+ and methods (both bound and unbound). Extension types can easily
2021be made to support weak references; see section \ref {weakref-extension },
2122`` Weak References in Extension Types,'' for more information.
2223
23- \strong {Warning:}
24- The desired semantics of weak-reference proxy objects are not
25- completely clear; it is very difficult to create proxies which behave
26- exactly like the type of the referent. The details of these objects
27- are likely to change to some degree before the final release as
28- experience reports become available.
29-
3024
3125\begin {funcdesc }{ref}{object\optional {, callback}}
3226 Return a weak reference to \var {object}. If \var {callback} is
@@ -56,7 +50,6 @@ \section{\module{weakref} ---
5650 \var {object} is still alive, to references are equal if the objects
5751 are equal (regardless of the \var {callback}). If the \var {object}
5852 has been deleted, they are equal iff they are identical.
59-
6053\end {funcdesc }
6154
6255\begin {funcdesc }{mapping}{\optional {dict\optional {, weakkeys=0}}}
@@ -198,8 +191,8 @@ \subsection{Weak References in Extension Types
198191
199192For an object to be weakly referencable, the extension must include a
200193\ctype {PyObject *} field in the instance structure for the use of the
201- weak reference mechanism; it will be initialized by Python's functions
202- for object creation . It must also set the \code {tp_weaklistoffset}
194+ weak reference mechanism; it must be initialized to \NULL {} by the
195+ object's constructor . It must also set the \member {tp_weaklistoffset}
203196field of the corresponding type object to the offset of the field.
204197For example, the instance type is defined with the following structure:
205198
0 commit comments