Adding item in front of a list

Duncan Booth duncan at
Thu Apr 10 11:40:38 CEST 2003

Tim Peters < at> wrote in
news:mailman.1049902101.26281.python-list at 

> Guido says he also wishes list.insert() had been defined with the
> arguments in the opposite order, so that list.insert(object) could
> have a natural default index argument of 0.  I'd like to change that
> too, but it's clearly too late for that one.
I don't actually see the problem with this. list.insert() currently takes 
exactly two arguments, therefore there would be no backwards compatibility 
issues with allowing it to take one or two arguments where a single 
argument acts as though you had given two but the first defaulted to 0. 
Just like 'range' does in fact!

Duncan Booth                                             duncan at
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?

More information about the Python-list mailing list