random...@fastmail.us wrote:
On Tue, Feb 24, 2015, at 00:20, Gregory Ewing wrote:
This is why I suggested registering a listener object
plus a method name instead of a callback. It avoids that
reference cycle, because there is no long-lived callback
object keeping a reference to the listener.
How does that help? Everywhere you would have had a reference to the
"callback object", you now have a reference to the listener object.
The point is that the library can keep a weak reference
to the listener object, whereas it can't reliably keep
a weak reference to a bound method.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list