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
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
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
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
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
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
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
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
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
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
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
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
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
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
14 matches
Mail list logo