Re: [C++-sig] Passing opaque data to C++ callback from Python

2014-12-18 Thread Peter LaDow
On Thu, Dec 18, 2014 at 8:10 PM, Stefan Seefeld wrote: > That sounds a bit confusing to me. :-) > Typically, if you associate state with a callback (a "closure"), you > think of it as an object whose member function is the callback. But > here, the callback function lives in Python, while you want

Re: [C++-sig] Passing opaque data to C++ callback from Python

2014-12-18 Thread Stefan Seefeld
On 18/12/14 10:43 PM, Peter LaDow wrote: > Thanks for the reply! > > On Thu, Dec 18, 2014 at 9:16 AM, Stefan Seefeld wrote: >> You defined 'do_something' as a callback, and registered it so it could >> be called from C++, yes ? Then, in your implementation of > Yes. At some pointer in the future,

Re: [C++-sig] Passing opaque data to C++ callback from Python

2014-12-18 Thread Peter LaDow
Thanks for the reply! On Thu, Dec 18, 2014 at 9:16 AM, Stefan Seefeld wrote: > You defined 'do_something' as a callback, and registered it so it could > be called from C++, yes ? Then, in your implementation of Yes. At some pointer in the future, the Python function 'do_something' will be calle

Re: [C++-sig] Passing opaque data to C++ callback from Python

2014-12-18 Thread Stefan Seefeld
On 16/12/14 11:13 PM, Peter LaDow wrote: > I'm embedding Python (using boost::python) into an application plugin > that uses callbacks. Essentially, I want to do something like: > > In Python (say test.py): > > def do_something(): > ... > > register_callback(do_something) > > And on the C++ side