[Python-3000] characters data type
Michael Spencer
mahs at telcopartners.com
Wed May 3 15:59:43 CEST 2006
Nick Coghlan wrote:
> Guido van Rossum wrote:
>> This also explains
>> why I'm no fan of the oft-proposed idea that slices should avoid
>> making physical copies even if they make logical copies -- the
>> complexity of that approach horrifies me.)
>
> FWIW, I've now realised it is possible to create a "seqview" type which
> provides a view of an existing sequence. Slice operations on the seqview would
> also produce views of the original container.
>
> That means implementing a memory-efficient approach on top of containers with
> copy-on-slice semantics isn't as hard as I thought, and only people that care
> about that would have to deal with the complexity.
>
...
>
Here, should you wish to experiment, is a pure-python implementation of a
numpy-ish array that does just that with either list or array.array as the
underlying sequence:
http://svn.brownspencer.com/pyarray/trunk/
Michael
More information about the Python-3000
mailing list