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

Roy Smith roy at panix.com
Fri Mar 10 17:24:18 CET 2006

Antoon Pardon  <apardon at forel.vub.ac.be> wrote:
>Do you have trouble remembering that range(n) is actually providing the
>second parameter to the function and what it does?

Yes.  I don't use range() everyday, and it's very rare that I use more
than one argument.  I do remember that there are additional (optional)
arguments to range which alter the sequence (start point and step),
but I certainly don't remember which is which.  If I needed to use it,
I would go look it up.  On the other hand, if I saw "range (10,
step=2)" written, it would be immediately obvious what was going on
without need to refer to the docs.

More information about the Python-list mailing list