[C++-sig] Fwd: [boost-python] Making a reference to the PyObject* in construct()

Austin Bingham austin.bingham at gmail.com
Sun Sep 27 07:30:35 CEST 2009


Thanks for the link, but I think I misspoke a bit. I do understand
borrowed vs. owned references in general, but I'm not sure about the
pointer in the specific context of the construct() call. Is it
borrowed or pre-incremented?

However, a little poking around the boost.python source seems to
indicate that it the pointers in that context are borrowed. The
evidence I have is that boost.python's own shared_ptr converter,
python/converter/shared_ptr_from_python.hpp, is using 'borrowed' when
it forms a reference to the PyObject.

So, can anyone verify that this is correct?

Austin

On Sat, Sep 26, 2009 at 6:07 PM, troy d. straszheim <troy at resophonic.com> wrote:
> Austin Bingham wrote:
>>
>> I can't find any documentation re: the "borrowed" nature of obj_ptr,
>> so I really just assumed that it was a normal, pre-incremented
>> reference. Any help on this would be great. Thanks.
>>
>
> Here's a good thread on this, thanks to Alex Mohr:
>
> http://mail.python.org/pipermail/cplusplus-sig/2009-February/014294.html
>
> -t
>
>
>
> _______________________________________________
> Cplusplus-sig mailing list
> Cplusplus-sig at python.org
> http://mail.python.org/mailman/listinfo/cplusplus-sig
>


More information about the Cplusplus-sig mailing list