Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #86038 > unrolled thread
| Started by | Devin Jeanpierre <jeanpierreda@gmail.com> |
|---|---|
| First post | 2015-02-21 06:24 -0800 |
| Last post | 2015-02-21 06:24 -0800 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Design thought for callbacks Devin Jeanpierre <jeanpierreda@gmail.com> - 2015-02-21 06:24 -0800
| From | Devin Jeanpierre <jeanpierreda@gmail.com> |
|---|---|
| Date | 2015-02-21 06:24 -0800 |
| Subject | Re: Design thought for callbacks |
| Message-ID | <mailman.18965.1424528721.18130.python-list@python.org> |
On Fri, Feb 20, 2015 at 9:42 PM, Chris Angelico <rosuav@gmail.com> wrote: > No, it's not. I would advise using strong references - if the callback > is a closure, for instance, you need to hang onto it, because there > are unlikely to be any other references to it. If I register a > callback with you, I expect it to be called; I expect, in fact, that > that *will* keep my object alive. For that matter, if the callback is a method, you need to hang onto it, because method wrappers are generated on demand, so the method would be removed from the valid callbacks instantly. Weak references for callbacks are broken. -- Devin
Back to top | Article view | comp.lang.python
csiph-web