Re: [C++-sig] function with >15 args yields get_signature error

2009-10-26 Thread William Ladwig
There is a config macro BOOST_PYTHON_MAX_ARITY which may work for you. I'm not sure how high you can increase this number though. Refer to: http://www.boost.org/doc/libs/1_40_0/libs/python/doc/v2/configuration.html -Original Message- From: cplusplus-sig-bounces+wladwig=wdtinc@pyt

Re: [C++-sig] wrapping reference members

2009-07-22 Thread William Ladwig
You may need to create a getter and a setter in your wrapper, and then you can use the "make_function" function to change the CallPolicy when you use create a property. I think you want your call policy to be return_internal_reference<> and that will handle the lifetime correctly. Here is a re

Re: [C++-sig] Boost.Python: same class in several modules

2009-07-14 Thread William Ladwig
Are you using the static or dynamic version of the boost python library? This looks similar to a problem a coworker had and switching to the dynamic version of the library fixed his problem. According to the documentation, the dynamic version of the library "contains a type conversion registry

Re: [C++-sig] Building with Scons

2009-07-07 Thread William Ladwig
d changing the name to include "lib" (since scons also generates called libcylucene.so) but it doesnt work. My module looks like this: void init_util(); BOOST_PYTHON_MODULE(cylucene) { init_util(); } On Tue, Jul 7, 2009 at 2:53 AM, William Ladwig wrote: > Does the name of the module

Re: [C++-sig] Building with Scons

2009-07-06 Thread William Ladwig
Never mind, those single quotes looked like one double quote on my screen From: cplusplus-sig-bounces+wladwig=wdtinc@python.org [cplusplus-sig-bounces+wladwig=wdtinc@python.org] On Behalf Of William Ladwig [wlad...@wdtinc.com] Sent: Monday

Re: [C++-sig] Building with Scons

2009-07-06 Thread William Ladwig
Does the name of the module defined in your BOOST_PYTHON_MODULE section match the name of the .so file (assuming you are using Linux)? That's usually the error I get when I have a name mismatch. Also, I haven't really used scons, but shouldn't this: env.SharedLibrary(target='cylucene', sourc

Re: [C++-sig] boost::python and threads

2009-07-04 Thread William Ladwig
lf Of William Ladwig [wlad...@wdtinc.com] Sent: Saturday, July 04, 2009 1:34 PM To: Development of Python/C++ integration Subject: Re: [C++-sig] boost::python and threads It looks to me like you have a garbage collection problem going on. If you create a wrapped c++ object in python, then pyth

Re: [C++-sig] boost::python and threads

2009-07-04 Thread William Ladwig
It looks to me like you have a garbage collection problem going on. If you create a wrapped c++ object in python, then python is going to own the object and will destroy it when its reference count goes to 0. In your python example script at the bottom, you call the Ticker's run() function, wh

Re: [C++-sig] wrapping operator=

2009-05-25 Thread William Ladwig
Generally how that situation is handled on the Python side is to use the container emulation API, so that assigning all values would look like this to a user of your class: data[:] = 42. To do this, you just need to write a small c++ wrapper to expose the __setitem__(self, key, value) function

Re: [C++-sig] variable argument number and BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS

2009-05-21 Thread William Ladwig
t, you will read fewer stupid question from me in this list ;-) Hans - Ursprüngliche Mail > Von: William Ladwig > An: Development of Python/C++ integration > Gesendet: Donnerstag, den 21. Mai 2009, 18:30:46 Uhr > Betreff: Re: [C++-sig] variable argument number and > B

Re: [C++-sig] variable argument number and BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS

2009-05-21 Thread William Ladwig
I haven't tried this myself, but I think all you need to do to wrap the member function is this: .def("info", (void(A::*)(int))0, A_info_overloads()); Hope this helps, Bill -Original Message- From: cplusplus-sig-bounces+wladwig=wdtinc@python.org [mailto:cplusplus-sig-bounces+wladwi

Re: [C++-sig] operator+(A, B) without B::B() default constructor in boost.python

2009-05-19 Thread William Ladwig
It looks to me like you're missing a '()' next to your 'init<>' in the class wrapper for B. Try changing this: class_("B",init)//line 19 ; to this: class_("B",init())//line 19 ; The only operator that has given me problems is the << operator. I've had pretty good success

Re: [C++-sig] Extended python system needs access to cPickle in c++

2009-05-05 Thread William Ladwig
You can import python modules in C++ using the import function. See here: http://www.boost.org/doc/libs/1_39_0/libs/python/doc/v2/import.html You can also make your C++ extension classes 'pickleable' using boost python's pickle suite: http://www.boost.org/doc/libs/1_39_0/libs/python/doc/v2/pic

Re: [C++-sig] problem w/intermodule communication

2008-11-25 Thread William Ladwig
Neal, Try adding: register_ptr_to_python< boost::shared_ptr >(); to your BOOST_PYTHON_MODULE(test2) section. Hope this helps, Bill From: [EMAIL PROTECTED] [EMAIL PROTECTED] On Behalf Of Neal Becker [EMAIL PROTECTED] Sent: Monday, November 24, 2008 6:1