Python Feature Request: Allow changing base of member indices to 1

Javier Bezos see_below_no_spam at
Sun Apr 15 19:42:13 CEST 2007

> Here is a document giving good reasons for indexing to start at
> zero, as in Python.
> The author has done a bit:

Dijkstra's argument is obsolete, as it is based on
how array length was computed many years ago -- if
we have an array a = b..e, then the lenght of a
is e-b (half open range). Good at low level

But a quarter of a century after we know concepts
are much better than low level programming and
explicit computations -- if we have an array
a = b..e, then the length of a should be a.length()
(or a.length(b,e)), and it is independent of
arbitrary ranges, index bases, or even steps
(eg, {-4, -2, 0, 2, 4}).

Of course, the index base should be always the
same _by default_ (individual lists could require
another index base, and that's fine). Otherwise
it would a mess, as you said.


More information about the Python-list mailing list