Python "why" questions

Ian Kelly ian.g.kelly at gmail.com
Fri Aug 13 19:10:16 EDT 2010


On Fri, Aug 13, 2010 at 11:53 AM, Martin Gregorie
<martin at address-in-sig.invalid> wrote:
> In a higher level language 1-based indexing is just as limiting as 0-
> based indexing. What you really want is the ability to declare the index
> range to suit the problem: in Algol 60 it is very useful to be able to
> declare something like:
>
>        real sample[-500:750];

Ugh, no.  The ability to change the minimum index is evil.  I don't
much care whether a high-level language uses 0-based or 1-based
indexing, but I do care that it is consistent.  On the occasions when
I am forced to use Visual Basic, the single biggest wart that drives
me up a wall is constantly having to figure out whether the particular
thing that I am currently indexing is 0-based or 1-based.

Cheers,
Ian



More information about the Python-list mailing list