Roundup Robot added the comment:
New changeset 78b0f294674c by Richard Oudkerk in branch '2.7':
Issue #15412: Remove erroneous note about weakrefs
http://hg.python.org/cpython/rev/78b0f294674c
New changeset 24b13be81d61 by Richard Oudkerk in branch '3.2':
Issue #15412: Remove erroneous note
Changes by Richard Oudkerk shibt...@gmail.com:
--
resolution: - fixed
stage: - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15412
___
New submission from Richard Oudkerk shibt...@gmail.com:
In the documentation on weakrefs there is the following quote
Note: Weak references to an object are cleared before the object’s
__del__() is called, to ensure that the weak reference callback
(if any) finds the object still
Antoine Pitrou pit...@free.fr added the comment:
In the documentation on weakrefs there is the following quote
Note: Weak references to an object are cleared before the object’s
__del__() is called, to ensure that the weak reference callback
(if any) finds the object still
Richard Oudkerk shibt...@gmail.com added the comment:
The weakref is dead but it's still a weakref, and it can be used to
e.g. index a container of existing weakrefs (cf. WeakSet,
WeakKeyDictionary, WeakValueDictionary).
Ah.
I had assumed that since dead weakrefs were unhashable you
Antoine Pitrou pit...@free.fr added the comment:
I had assumed that since dead weakrefs were unhashable you couldn't
safely use them as keys in a dict. (Presumably removal of a no longer
hashable key from a dict is O(n)?)
They are unhashable if you didn't hash them alive. Otherwise they