Adding item in front of a list

Thomas Guettler pan-newsreader at thomas-guettler.de
Wed Apr 9 08:42:37 EDT 2003


Hi!

I think it would be nice if
 l=[2, 3, 4]
 l.insert(1)

would insert in front of the list, as opposed to append() which adds new
elements at the end.

l.insert(1) looks better than l.insert(-1,1)

 thomas


-- 
Thomas Guettler <guettli at thomas-guettler.de>
http://www.thomas-guettler.de




More information about the Python-list mailing list