Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #86396 > unrolled thread

Re: Design thought for callbacks

Started byCem Karan <cfkaran2@gmail.com>
First post2015-02-25 07:46 -0500
Last post2015-02-25 07:46 -0500
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.


Contents

  Re: Design thought for callbacks Cem Karan <cfkaran2@gmail.com> - 2015-02-25 07:46 -0500

#86396 — Re: Design thought for callbacks

FromCem Karan <cfkaran2@gmail.com>
Date2015-02-25 07:46 -0500
SubjectRe: Design thought for callbacks
Message-ID<mailman.19180.1424868383.18130.python-list@python.org>
On Feb 24, 2015, at 8:23 AM, Fabio Zadrozny <fabiofz@gmail.com> wrote:

> Hi Cem,
> 
> I didn't read the whole long thread, but I thought I'd point you to what I'm using in PyVmMonitor (http://www.pyvmmonitor.com/) -- which may already cover your use-case.
> 
> Take a look at the callback.py at https://github.com/fabioz/pyvmmonitor-core/blob/master/pyvmmonitor_core/callback.py
> 
> And its related test (where you can see how to use it): https://github.com/fabioz/pyvmmonitor-core/blob/master/_pyvmmonitor_core_tests/test_callback.py (note that it falls back to a strong reference on simple functions -- i.e.: usually top-level methods or methods created inside a scope -- but otherwise uses weak references).

That looks like a better version of what I was thinking about originally.  However, various people on the list have convinced me to stick with strong references everywhere.  I'm working out a possible API right now, once I have some code that I can use to illustrate what I'm thinking to everyone, I'll post it to the list.

Thank you for showing me your code though, it is clever!

Thanks,
Cem Karan

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web