Re: [C++-sig] Pickle python subclass of C++ interface

2010-07-17 Thread Ralf W. Grosse-Kunstleve
> Ok I'll give that a whirl. I was hoping to avoid doing __getinitargs__() > for each subclass as I have quite a few of them. If I didn't have a C++ > base class then the pickling would just work as is. There's no way I > can get back to that sort of situation with the C++ base class is there? I d

Re: [C++-sig] Pickle python subclass of C++ interface

2010-07-17 Thread John Reid
Ralf W. Grosse-Kunstleve wrote: I think all you need to do is add .enable_pickling() to your Boost.Python wrapper and def __getinitargs__(self): return (x,y,z) to your subclass. You could also use __getstate__, __setstate__, but I'd try to work with just __getinitargs__ first. See also:

Re: [C++-sig] Pickle python subclass of C++ interface

2010-07-17 Thread Ralf W. Grosse-Kunstleve
I think all you need to do is add .enable_pickling() to your Boost.Python wrapper and def __getinitargs__(self): return (x,y,z) to your subclass. You could also use __getstate__, __setstate__, but I'd try to work with just __getinitargs__ first. See also: http://www.boost.org/doc/libs/1_4

Re: [C++-sig] [patch] Make boost python accessible by multiple threads

2010-07-17 Thread Niall Douglas
On 16 Jul 2010 at 12:33, Jim Bosch wrote: > But I don't know much more than this, and I'm also curious to hear the > story told by someone who has more information...why hasn't > multithreading support been added? Does it just add too much overhead > for those who don't need it? Atomic exchan

Re: [C++-sig] [patch] Make boost python accessible by multiple threads

2010-07-17 Thread Niall Douglas
On 16 Jul 2010 at 13:38, Charles Solar wrote: > I mentioned it before but I have this patch for boost python that adds > code to lock and unlock the gil at all the boundaries I have found > between python and boost python. This makes it so multiple threads > can call into python without the user

[C++-sig] Pickle python subclass of C++ interface

2010-07-17 Thread John Reid
Hi, I'm using boost.python. I want to pickle some python subclasses of a C++ base. The C++ base does not have any state, it is just an interface. Is there an easy way to ask the python pickling machinery to ignore the C++ base? I'm not sure if I should use the boost.python pickling support or

Re: [C++-sig] reuse C++ classes that have been wrapped with SWIG

2010-07-17 Thread Marco Selinger
Dear Ralf, thank you for the links. Unfortunately I don't get the point. Where is the swig interface defined? Where is the boost.python module defined? What is the key idea how the two python wrappers are linked together? If you or somebody else could briefly outline these steps in english text (