[Python-ideas] [Python-Dev] Inclusive Range
Carl M. Johnson
cmjohnson.mailinglist at gmail.com
Tue Oct 5 10:54:04 CEST 2010
Changing range would only make sense if lists were also changed to
start at 1 instead of 0, and that's never gonna happen. It's a
massively backwards incompatible change with no real offsetting
advantage.
Still, if you were designing a brand new language today, would you
have arrays/lists start at 0 or 1? (Or compromise and do .5?) I
personally lean towards 1, since I recall being frequently tripped up
by the first element in an array being a[0] way back when I first
learn C++ in the 20th century. But maybe this was because I had been
messed up by writing BASIC for loops from 1 to n before that? Is there
anyone with teaching experience here? Is this much of a problem for
young people learning Python (or any other zero-based indexing
language) as their first language?
What do you guys think? Now that simplifying pointer arithmetic isn't
such an important consideration, is it still better to do zero-based
indexing?
-- Carl Johnson
More information about the Python-ideas
mailing list