[email protected]
[Top] [All Lists]

Re: [C++-sig] call policies help needed

Subject: Re: [C++-sig] call policies help needed
From: "Roman Yakovenko"
Date: Thu, 25 May 2006 20:24:28 +0300
On 5/25/06, Neal Becker <[email protected]> wrote:
> I'm confused.  I thought it worked like this:
> In python, create an a=A().  Then create a b=B(a).  Using
> custodian_and_ward, 'a' will not be deleted as long as 'b' is alive.  Then
> c=getA() using return_internal_reference will ensure that 'b' is not
> deleted as long as python holds 'c'.  Is this not correct?

Please, read my first post and the answer of David Abrahams.

"a" could be created from C++ and not from Python. In this case boost.python
library does not manage life time of object "a".

I think, that pyplusplus should generate "safe" code, and only after
this efficient.
Also, you can customize the return value policy

Roman Yakovenko
C++ Python language binding
C++-sig mailing list
[email protected]

<Prev in Thread] Current Thread [Next in Thread>