Why python doesn't use syntax like function(, , x) for default parameters?

Antoon Pardon apardon at forel.vub.ac.be
Mon Mar 13 04:50:56 EST 2006


Op 2006-03-10, Terry Reedy schreef <tjreedy at udel.edu>:
>
> "Antoon Pardon" <apardon at forel.vub.ac.be> wrote in message 
> news:slrne1372v.mt4.apardon at rcpc42.vub.ac.be...
>> but nobody seems to have
>> a problem with range(n) where n suddenly is the second parameter and
>> we use the default for the first.
>
> Actually, I consider the unique calling pattern for x/range to be something 
> of a wart.  Learning this inconsistency was at least a minor problem.  It 
> is a rather extreme example of typing laziness beats purity.

Well then we can at least agree on that.

> Given that enumerate() eliminate many uses of range(), it might be worth 
> considering requiring the start param.  range(0,n) only takes two more 
> keystrokes.  Better maybe to shorten range to rng to get them back ;-)

I can't use enumerate that much. I usually work with a Table which is
like a list, but the index can start at any integer value. Enumerate
doesn't work well with a table.

-- 
Antoon Pardon



More information about the Python-list mailing list