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

Steven D'Aprano steve at REMOVE.THIS.cybersource.com.au
Sun Apr 15 02:19:17 EDT 2007


On Sat, 14 Apr 2007 22:02:47 -0700, Alex Martelli wrote:

> Steven D'Aprano <steve at REMOVE.THIS.cybersource.com.au> wrote:
> 
>> On Sat, 14 Apr 2007 20:34:46 -0700, Dan Bishop wrote:
>> 
>> > On Apr 14, 10:55 am, Dennis Lee Bieber <wlfr... at ix.netcom.com> wrote:
>> > 
>> >>         The FORTRAN family had started as 1-based (F95, and Ada, now allow
>> >> for each array to have its own "base" => x : array (-10..10) of float).
>> >> Pascal, I forget...
>> > 
>> > Pascal allows arbitrary array bases.  It's where Ada got the idea.
>> 
>> It does? Since when? 
> 
> Ever since Pascal existed, the syntax has been "array[lower..upper] of
> sometype" -- no default value for lower (neither 0 nor 1 nor other).

*slaps head*

Of course it does! D'oh!

We always used to write array[1..n] for an n item array, which is a
convention, not enforced by the compiler.



-- 
Steve



More information about the Python-list mailing list