The behavior of List.insert

David Ripton dripton at ripton.net
Tue Apr 29 12:30:03 EDT 2003


York wrote:

> given
> 
> mylist = [1,2,3,4,5], 
> 
> mylist.insert(-1,99) will make mylist to be [99,1,2,3,4,5]
> 
> just wonder why not let it to be [1,2,3,4,99,5]

This is fixed in Python 2.3b1.

-- 
David Ripton    dripton at ripton.net






More information about the Python-list mailing list