[C++-sig] Re: Exposing copy constructors with Boost::Python

Christopher Dawson dawson at physics.uq.edu.au
Fri Jul 23 05:05:46 CEST 2004


David Abrahams wrote:

>Your copy ctor doesn't copy the contents of the array.  Intentional?
>
>  
>
Bah. I should have just pasted the code. The copy ctor does copy the 
contents of the array.

>What do you mean by "copying the object from Python"?
>
>  
>
I thought I meant b = a, and even though I was aware this just makes b a 
reference to a, didn't appreciate it.

I now mean a deep copy  b = copy.deepcopy(a). So this means either 
providing some method by which the object can be pickled, or exposing a  
__deepcopy__ function. Or something.

Thanks, that helped a lot.

Chris



More information about the Cplusplus-sig mailing list