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
人言落日是天涯,望极天涯不见家 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
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
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