Re: [C++-sig] C++ copy construction and Python object copies

2015-05-29 Thread Stefan Seefeld
On 29/05/15 06:48 PM, Alex Mohr wrote: > On 5/29/2015 7:28 AM, Stefan Seefeld wrote: >> Python's copy module allows for objects to be copied. The protocol for >> this will look up special method __copy__. It seems to me that this >> would trivially work for C++ objects providing a copy-constructor.

Re: [C++-sig] C++ copy construction and Python object copies

2015-05-29 Thread Alex Mohr
On 5/29/2015 7:28 AM, Stefan Seefeld wrote: Python's copy module allows for objects to be copied. The protocol for this will look up special method __copy__. It seems to me that this would trivially work for C++ objects providing a copy-constructor. However, the copy-constructor isn't automatical

[C++-sig] C++ copy construction and Python object copies

2015-05-29 Thread Stefan Seefeld
Hello, Python's copy module allows for objects to be copied. The protocol for this will look up special method __copy__. It seems to me that this would trivially work for C++ objects providing a copy-constructor. However, the copy-constructor isn't automatically bound to __copy__. While I can cert

[C++-sig] Boost.Python C++ object reference in Python: unexpected behaviour.

2015-05-29 Thread Christoff Kok
Hi, I am having an issue with Boost.Python with a very simple use case. I am returning a reference to an object, and it seems that my python object looses its C++ object's reference at a stage for some reason. Please see my *example* below reproducing this issue. *C++ Code:* #include #include