Re: how to refer to partial list, slice is too slow?

2007-05-11 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, 人言落日是天涯,望极天涯不见家 wrote: > I make a sample here for the more clearly explanation > > s = " . - this is a large string data - ..." > > def parser1(data) > # do some parser > ... > # pass the remainder to next parser > parser2(data[100:]) > > def

Re: how to refer to partial list, slice is too slow?

2007-05-10 Thread Martin v. Lo
人言落日是天涯,望极天涯不见家 schrieb: > I'm a python newbie. It seems the slice operation will do copy. > for example: a = [1,2,3,4,5,6,7,8,9,0] b = a[7:] b > [8, 9, 0] a.remove(9) a > [1, 2, 3, 4, 5, 6, 7, 8, 0] b > [8, 9, 0] > > if the list have large members, the slice operatio

Re: how to refer to partial list, slice is too slow?

2007-05-10 Thread 人言落日是天涯,望极天涯不见家
I make a sample here for the more clearly explanation s = " . - this is a large string data - ..." def parser1(data) # do some parser ... # pass the remainder to next parser parser2(data[100:]) def parser2(data) # do some parser ... # pass the remainder

how to refer to partial list, slice is too slow?

2007-05-10 Thread 人言落日是天涯,望极天涯不见家
I'm a python newbie. It seems the slice operation will do copy. for example: >>> a = [1,2,3,4,5,6,7,8,9,0] >>> b = a[7:] >>> b [8, 9, 0] >>> a.remove(9) >>> a [1, 2, 3, 4, 5, 6, 7, 8, 0] >>> b [8, 9, 0] if the list have large members, the slice operations will consume many times. for instance, I h