Message166006
> 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 alive.
>
> But I think the weakref is always dead by the time the callback is
> invoked.
It's true, the doc needs fixing.
> Which does prompt a question: what use is there for the weakref
> argument to the callback if it already dead?
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). |
|
Date |
User |
Action |
Args |
2012-07-21 10:23:53 | pitrou | set | recipients:
+ pitrou, docs@python, sbt |
2012-07-21 10:23:52 | pitrou | link | issue15412 messages |
2012-07-21 10:23:52 | pitrou | create | |
|