[prev in list] [next in list] [prev in thread] [next in thread] 

List:       python-cpp-sig
Subject:    [C++-sig] Problem with PyMethodDef and non-static functions
From:       seefeld () sympatico ! ca (Stefan Seefeld)
Date:       2006-09-28 19:19:22
Message-ID: 451C203A.2090604 () sympatico ! ca
[Download RAW message or body]

Jon Kristensen wrote:

> Thanks for your reply. I don't understand the following:
> 
>       * What purpose does the struct MyType serve?

You ask for a way to bind a C++ member function to a python method.
But a member is always a member of some object, so MyType provides one.
Both, MyType as well as MyType::func are placeholders for your own code.

>       * What's extract_object_from_self? (Don't find anything on
>         Google.)

Indeed. You have to write that yourself, i.e. a function to extract
a MyType pointer (again, placeholder for your own object pointer)
from the python wrapper through which the member function is to be invoked.

Boost.python does all that for you automagically...

Regards,
		Stefan

-- 

      ...ich hab' noch einen Koffer in Berlin...

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic