Design thought for callbacks

Ian Kelly ian.g.kelly at gmail.com
Thu Feb 26 14:54:08 EST 2015


On Feb 26, 2015 4:00 AM, "Cem Karan" <cfkaran2 at gmail.com> wrote:
>
>
> On Feb 26, 2015, at 12:36 AM, Gregory Ewing <greg.ewing at canterbury.ac.nz>
wrote:
>
> > Cem Karan wrote:
> >> I think I see what you're talking about now.  Does WeakMethod
> >> (https://docs.python.org/3/library/weakref.html#weakref.WeakMethod)
solve
> >> this problem?
> >
> > Yes, that looks like it would work.
>
>
> Cool!

Sometimes I wonder whether anybody reads my posts. I suggested a solution
involving WeakMethod four days ago that additionally extends the concept to
non-method callbacks (requiring a small amount of extra effort from the
client in those cases, but I think that is unavoidable. There is no way
that the framework can determine the appropriate lifetime for a
closure-based callback.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20150226/53603f31/attachment.html>


More information about the Python-list mailing list