Re: Arrays vs slices

2009-06-11 Thread Steven Schveighoffer
bearophile Wrote: > Steve Schveighoffer: > > No, please no! Do I really need to carry around an integer that is going > > to be unused 99.9% of the time (In my case, probably 100%)? I'd rather > > have a special type that has a stride. > > Strides aren't essential, but once in a while they ar

Re: Arrays vs slices

2009-06-11 Thread bearophile
Steve Schveighoffer: > No, please no! Do I really need to carry around an integer that is going > to be unused 99.9% of the time (In my case, probably 100%)? I'd rather > have a special type that has a stride. Strides aren't essential, but once in a while they are useful, I use them now and t

Re: Arrays vs slices

2009-06-10 Thread Steve Schveighoffer
On Tue, 09 Jun 2009 16:22:39 -0400, bearophile wrote: > Once the language tells apart arrays and slices, the arrays may have a > third field that represents the capacity, and the slices may have a > third field that represents the stride (that defaults to 1). No, please no! Do I really need to c

Arrays vs slices

2009-06-09 Thread bearophile
Once the language tells apart arrays and slices, the arrays may have a third field that represents the capacity, and the slices may have a third field that represents the stride (that defaults to 1). Python slices with strides specified: >>> a = range(10) >>> a [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>>