Re: [C++-sig] wrapped std::vector slice affecting items in a python list

2012-04-02 Thread babak
Hi, Thought you might be interested to know that I think the cause of the problem in my example is the iter method that the indexing suite adds. Unlike getitem it doesn't seem to return proxy objects, so when I slice insert into the cpp container some of the references made by iterating through it

Re: [C++-sig] wrapped std::vector slice affecting items in a python list

2011-08-17 Thread Babak Khataee
okay cool. I think that's a reasonable compromise. It should also (hopefully) make it possible to move away from the indexing suite as well. thanks for your help! On 16 August 2011 21:41, Jim Bosch wrote: > On 08/16/2011 11:29 AM, Babak Khataee wrote: > >> Okay thanks for the info. >> >>Thi

Re: [C++-sig] wrapped std::vector slice affecting items in a python list

2011-08-16 Thread Jim Bosch
On 08/16/2011 11:29 AM, Babak Khataee wrote: Okay thanks for the info. Things are also a lot safer if you only wrap vectors as const; it's exposing the mutators to Python that gets really difficult. Is the const-ness of a wrapped object just a side effect of not exposing methods which

Re: [C++-sig] wrapped std::vector slice affecting items in a python list

2011-08-16 Thread Babak Khataee
Okay thanks for the info. Things are also a lot safer if you only wrap vectors as const; it's exposing > the mutators to Python that gets really difficult. > Is the const-ness of a wrapped object just a side effect of not exposing methods which modify it or is it due to something else more explic

Re: [C++-sig] wrapped std::vector slice affecting items in a python list

2011-08-16 Thread Jim Bosch
On 08/16/2011 07:32 AM, babak wrote: Hi Jim Thanks for your response. I'm abit surprised that this is the case, I kind of thought that indexing_suite was there to bridge this incompatibility. Is it normal then for large projects reliant on value based containers to copy data when going from pyt

Re: [C++-sig] wrapped std::vector slice affecting items in a python list

2011-08-16 Thread babak
Hi Jim Thanks for your response. I'm abit surprised that this is the case, I kind of thought that indexing_suite was there to bridge this incompatibility. Is it normal then for large projects reliant on value based containers to copy data when going from python to c++ ? thanks babak -- View th

Re: [C++-sig] wrapped std::vector slice affecting items in a python list

2011-08-12 Thread Jim Bosch
On 08/12/2011 04:28 AM, babak wrote: Hi, I've come across some unusual behaviour that I was hoping some one might be able to explain to me. In python I have a list and a wrapped std::vector (using the vector_indexing_suite) where the list contains the items in the vector. If I slice insert ite