[Python-3000] Making more effective use of slice objects in Py3k

Guido van Rossum guido at python.org
Tue Aug 29 04:24:59 CEST 2006

On 8/28/06, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> Guido van Rossum wrote:
> > You seem to be utterly convinced of the superior performance of your
> > proposal without having done any measurements.
> For my part, superior performance isn't the main
> reason for considering string views. Rather it's
> the simplification that would result from replacing
> the current ad-hoc set of optional start-stop
> arguments with a single easy-to-remember idiom.
> What are your thoughts on that aspect?

A few days ago I posted a bit of code using start-stop arguments and
the same code written using string views. I didn't think the latter
looked better. The start-stop arguments are far from arbitrary. They
are only ad-hoc in the sense that they haven't been added to every API
-- only where they're needed occasionally for performance.

I still fear that a meme will develop that will encourage the use of
views in many cases where they aren't needed; newbies are more prone
to premature optimization than experienced developers, for whom this
feature is intended, and newbies will more likely copy sections of
code without understanding when/why various complexifications are

--Guido van Rossum (home page: http://www.python.org/~guido/)

More information about the Python-3000 mailing list