[Python-3000] characters data type

Nick Coghlan ncoghlan at gmail.com
Wed May 3 12:47:00 CEST 2006


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   |   ncoghlan at gmail.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://www.boredomandlaziness.org


More information about the Python-3000 mailing list