zero-copy array slicing

Trevor trevorperrin at hotmail.com
Tue Nov 19 04:38:53 EST 2002


Is a zero-copy array slicing operation possible?  Or would having two
arrays share the same elements cause too many problems?  I'm thinking
something like:

>>> a1 = array('b', [0, 1, 2, 3, 4, 5])
>>> a2 = a1.subsequence(slice(1, 4))
>>> a2
array('b', [1, 2, 3])
>>> a2[0] = 100
>>> a1
array('b', [0, 100, 2, 3, 4, 5])


Trevor



More information about the Python-list mailing list