Adding item in front of a list

Tim Peters tim_one at
Fri Apr 11 07:16:13 CEST 2003

[Duncan Booth]
>> 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!

[Thomas Guettler]
> I newer looked at the source of python, but I don't think that it would
> be difficult. Should this become a PEP or can someone with write
> access to the CSV just do it?

See my earlier reply to Duncan:  this particular idea is dead on arrival (a
PEP would be rejected; if someone checked in such a change it would be
reverted).  Saving you from needing to type 0 when you mean 0 doesn't
outweigh the ugliness of making the first argument mean different things
depending on how many arguments there are.

More information about the Python-list mailing list