]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
list_ass_slice(): Document the obscure new intent that deleting a slice
authorTim Peters <tim.peters@gmail.com>
Sat, 31 Jul 2004 21:53:19 +0000 (21:53 +0000)
committerTim Peters <tim.peters@gmail.com>
Sat, 31 Jul 2004 21:53:19 +0000 (21:53 +0000)
commit8fc4a916658aa4a24f29a6e1b438f910465cc22b
treea07574fecca021074488ead07a33d579a0a6b58c
parentc0cbc8611b5d9633796ade4b1cd37f332fa0b12f
list_ass_slice():  Document the obscure new intent that deleting a slice
of no more than 8 elements cannot fail.

listpop():  Take advantage of that its calls to list_resize() and
list_ass_slice() can't fail.  This is assert'ed in a debug build now, but
in an icky way.  That is, you can't say:

assert(some_call() >= 0);

because then some_call() won't occur at all in a release build.  So it
has to be a big pile of #ifdefs on Py_DEBUG (yuck), or the pleasant:

        status = some_call();
        assert(status >= 0);

But in that case, compilers may whine in a release build, because status
appears unused then.  I'm not certain the ugly trick I used here will
convince all compilers to shut up about status (status is always "used" now,
as the first (ignored) clause in a comma expression).
Objects/listobject.c