]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
This is a reorganization of list_ass_slice(). It should probably be reviewed,
authorArmin Rigo <arigo@tunes.org>
Fri, 30 Jul 2004 11:38:22 +0000 (11:38 +0000)
committerArmin Rigo <arigo@tunes.org>
Fri, 30 Jul 2004 11:38:22 +0000 (11:38 +0000)
commit1dd04a02e03e1765d9f2096d979de92927337dcb
tree5bbc0038acb57ed18f360cd01b482c1c3ac685f6
parenta37bbf2e5bf9d0854a774cdd1a972d0b7cc9e733
This is a reorganization of list_ass_slice().  It should probably be reviewed,
though I tried to be very careful.  This is a slight simplification, and it
adds a new feature: a small stack-allocated "recycled" array for the cases
when we don't remove too many items.

It allows PyList_SetSlice() to never fail if:
* you are sure that the object is a list; and
* you either do not remove more than 8 items, or clear the list.

This makes a number of other places in the source code correct again -- there
are some places that delete a single item without checking for MemoryErrors
raised by PyList_SetSlice(), or that clear the whole list, and sometimes the
context doesn't allow an error to be propagated.
Objects/listobject.c