Re: non-copy slices

2009-11-19 Thread tbourden
No I'm well aware that there is no deep copy of the objects and the lists only keep references to the objects and in essence they have the same objects in there. But this doesn't mean they are the same list. Modifications to slices are not written back to the original list. x = range(5) y = x[1:3]

Re: non-copy slices

2009-11-18 Thread tbourden
Hi, sth == something :) sorry for the abbreviation. I'm talking about the shallow copy, still it's a copy. Unnecessary in my case and the worst part in my scenario is the creation (allocation) and deletion of a very large number of lists of moderate size (a few hundred objects) generated due to sl

Re: non-copy slices

2009-11-18 Thread tbourden
Ahhh yes! that's exactly it. Thanks for pointing out! Themis On Wed, Nov 18, 2009 at 3:44 PM, Tim Golden wrote: > tbour...@doc.ic.ac.uk wrote: > > Hi, > > > > I was looking for a facility similar to slices in python library that > would > > avoid the implicit creation of a new list and copy of

non-copy slices

2009-11-18 Thread tbourden
Hi, I was looking for a facility similar to slices in python library that would avoid the implicit creation of a new list and copy of elements that is the default behaviour. Instead I'd rather have a lazy iteratable object on the original sequence. Well, in the end I wrote it myself but I was wond