Adding item in front of a list

Alex Martelli aleax at aleax.it
Sat Apr 12 18:43:46 EDT 2003


Skip Montanaro wrote:

>     Alex> Why can't mylist.insert use just the same "first argument means
>     Alex> different things" convention as range...?
> 
> Guido's feeling is that the convention used by range was a mistake, and
> intends not to repeat it.  (I believe this line of reasoning was already
> posted by Tim.)

It was (but I hadn't seen that post when I asked this question).  And on
reflection I concur -- I *hate* the few places in the Nutshell in which
I couldn't explain a function's behavior by means of Pythonic "optional
arguments", but rather had to resort to brackets meaning "optional" -- and 
range is a prime example of that.


Alex





More information about the Python-list mailing list