[C++-sig] boost::python constructing object from PyObject *

Dan Eloff dan.eloff at gmail.com
Wed Oct 29 22:18:17 CET 2008


On Wed, Oct 29, 2008 at 3:55 PM, David Abrahams <dave at boostpro.com> wrote:
> The above should be a complete guide.  Any questions?

Just two.

1) Should it be object(handle<>(borrowed(ptr))) or
object(borrowed(ptr)) ? Both seem to compile.

2) Can I repost that to a boost::python wiki, givng you credit of
course. Hopefully it will prevent others from having as many issues
with this.


Thanks for taking the time to explain handle in depth. I fixed my code
accordingly and all ref-counting issues went away.

-Dan


More information about the Cplusplus-sig mailing list