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


_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to