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.

It also means that I'm starting to think that any dimensioned array type that 
makes it into the standard library should adopt the copy-on-slice approach 
used by the builtin containers. The fancy indexing tricks and the 
avoid-copying-anything-at-all style can be left for the serious number 
crunching libraries like Numpy.

Cheers,
Nick.

-- 
Nick Coghlan   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org
_______________________________________________
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