Remove items from a list

Alex Martelli aleaxit at
Wed Sep 8 18:27:16 CEST 2004

Dennis Lee Bieber <wlfraed at> wrote:
>       And I'm not sure what Python does on the end of the list; is the
> termination dynamic (ie, it stops whenever the shortened list ends) or
> is based on the original length...

The former: it's based on an IndexError being raised when the index
becomes too big for the list (so a nice MemoryError will result from
    for x in mylist: mylist.append(x)
but that's another issue;-).


More information about the Python-list mailing list