Re: [C++-sig] take ownership in a call policy

2008-12-12 Thread Renato Araujo
Thanks David I will try explain more about my problems with ownership: I already expose this problem before here the ideas not fit yet. This is my problem. attention: I can't change the c++ code; struct object { object(object *parent=0) { //if (parent): append myself in parent

Re: [C++-sig] take ownership in a call policy

2008-12-12 Thread David Abrahams
on Fri Dec 12 2008, "Renato Araujo" wrote: > Hi guys, > > I'm creating a 2 new call_policy to my functions where I need take and > give back the ownership of my object. I would like reproduce this in > my precall or postcall function policy functions. > > http://www.boost.org/doc/libs/1_36_0/lib

Re: [C++-sig] boost::python::throw_error_already_set not in library

2008-12-12 Thread David Abrahams
on Fri Dec 12 2008, "Rocketman-AT-JSC" wrote: > Yes it's probably user error--but I have no clue why this is happening. I > did not do the build and the guy doing the build is not an expert boost user > either. Did he use bjam? You can verify the build by following the Boost.Python tutorial

Re: [C++-sig] boost::python::throw_error_already_set not in library

2008-12-12 Thread Rocketman@JSC
Yes it's probably user error--but I have no clue why this is happening. I did not do the build and the guy doing the build is not an expert boost user either. We have two builds one with gcc and one with intel. Notice the non-debug versions don't have the symbol. Here are the results from objd

Re: [C++-sig] boost::python::throw_error_already_set not in library

2008-12-12 Thread David Abrahams
on Fri Dec 12 2008, "Rocketman-AT-JSC" wrote: > Seems like this function only gets built into the debug version. Are you certain? It's hard to imagine that's actually the case. > We built the gcc library for 1.35 and it only appears in the > libboost_python_gcc32-mt-d-1_35 version. How did

[C++-sig] boost::python::throw_error_already_set not in library

2008-12-12 Thread Rocketman@JSC
Seems like this function only gets built into the debug version. We built the gcc library for 1.35 and it only appears in the libboost_python_gcc32-mt-d-1_35 version. Does anyone know why this does not get built into the non-debug version or how to make it get built in? TIA, Scott -- View th

Re: [C++-sig] take ownership in a call policy

2008-12-12 Thread Hugo Lima
On Fri, Dec 12, 2008 at 9:48 AM, Renato Araujo wrote: > Hi guys, > > I'm creating a 2 new call_policy to my functions where I need take and > give back the ownership of my object. I would like reproduce this in > my precall or postcall function policy functions. > > http://www.boost.org/doc/libs/1

Re: [C++-sig] Pickle an enum from c++

2008-12-12 Thread Ralf W. Grosse-Kunstleve
Could you try if the enum test works with your version of boost? What version do you have? I just tried it out (using the current boost svn trunk) and it works for me. I think it should work with any boost version after Dec 2006. Note that you have to use pickle.HIGHEST_PROTOCOL as in the test, oth

Re: [C++-sig] Pickle an enum from c++

2008-12-12 Thread Matthew Scouten (TT)
No, that didn't make a difference. -Original Message- From: cplusplus-sig-bounces+matthew.scouten=tradingtechnologies@python.org [mailto:cplusplus-sig-bounces+matthew.scouten=tradingtechnologies@py thon.org] On Behalf Of Ralf W. Grosse-Kunstleve Sent: Friday, December 12, 2008 10:2

Re: [C++-sig] Pickle an enum from c++

2008-12-12 Thread Ralf W. Grosse-Kunstleve
> Is there something I am supposed to do to the enum_ to make it work? Did you look at thid test? boost/libs/python/test/enum.cpp Do you have the .export_values()? (Not sure if that's important; I never use enum.) Ralf ___ Cplusplus-sig mailing list

Re: [C++-sig] Pickle an enum from c++

2008-12-12 Thread Matthew Scouten (TT)
Is there something I am supposed to do to the enum_ to make it work? If I try to 'dumps()' my enum I still get the exception I included in my earlier email. Funny thing, dumps-ing it with cPickle just gets the exception, while dumps-ing it with regular pickle also produces a crash from within the

Re: [C++-sig] Bug and patch for boost.pythonwithenable_shared_from_this

2008-12-12 Thread Nicolas Lelong
FWIW, it seems I can't reproduce the problem with current boost svn trunk code, the problem still existed in boost_1_37_0 though. I could not spot the changes made that fixed the problem. I took a look at the shared_ptr aliasing constructor, and made a patch to my boost_1_37_0 that solves the p

Re: [C++-sig] conversion problem

2008-12-12 Thread Luca Sbardella
you are right, that was silly. thanks a lot 2008/12/12 Hans Meine > On Thursday 11 December 2008 16:29:34 Luca Sbardella wrote: > > The error I get is > > *error C2668: 'boost::python::make_tuple' : ambiguous call to overloaded > > function > > could be 'boost::python::tuple boost::python::make_

[C++-sig] take ownership in a call policy

2008-12-12 Thread Renato Araujo
Hi guys, I'm creating a 2 new call_policy to my functions where I need take and give back the ownership of my object. I would like reproduce this in my precall or postcall function policy functions. http://www.boost.org/doc/libs/1_36_0/libs/python/doc/v2/faq.html#ownership How I can do this? How

Re: [C++-sig] conversion problem

2008-12-12 Thread Hans Meine
On Thursday 11 December 2008 16:29:34 Luca Sbardella wrote: > The error I get is > *error C2668: 'boost::python::make_tuple' : ambiguous call to overloaded > function > could be 'boost::python::tuple boost::python::make_tuple<_Ty1,_Ty2>(const > A0 &,const A1 &)'** > or 'boost::tuples::tuple >

Re: [C++-sig] Dynamic resolution of members and methods

2008-12-12 Thread Jérémie Delaitre
It works ! Thanks a lot. Jérémie Alex Mohr a écrit : Override the python special methods __getattr__ or __getattribute__. http://docs.python.org/reference/datamodel.html#attribute-access Alex Jérémie Delaitre wrote: Hello, I have a C++ class that use a custom property system. This propert

Re: [C++-sig] conversion problem

2008-12-12 Thread Luca Sbardella
I substituted the convert method in pair_to_tuple with the following static PyObject* convert(ctype const& v) { using namespace boost::python; list values; values.append(v.first); values.append(v.second); return incref(tuple(values)

Re: [C++-sig] Bug and patch for boost.python withenable_shared_from_this

2008-12-12 Thread Nicolas Lelong
Hi, > Could you at least ask Peter Dimov if he thinks the > dont_enable_shared_from_this patch could be generally useful? > Maybe he's OK adding it, then it wouldn't be a big deal > fixing Boost.Python, which would probably prevent a lot of > confusion and lost time in the future. I stumbled once

[C++-sig] Need help with inheritance problem

2008-12-12 Thread Simon Pickles
Hi, I am trying to expose part of the bullet dynamics library to my python code. I simply need to expose a few accessors of a type btVector3. This inherits from a class which is itself derived. I seem to be struggling to get this right. Here is my attempt: BOOST_PYTHON_MODULE(HybridZone) {