diff options
author | Tim Peters <tim.peters@gmail.com> | 2004-07-31 21:53:19 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2004-07-31 21:53:19 (GMT) |
commit | 8fc4a916658aa4a24f29a6e1b438f910465cc22b (patch) | |
tree | a07574fecca021074488ead07a33d579a0a6b58c /Doc | |
parent | c0cbc8611b5d9633796ade4b1cd37f332fa0b12f (diff) | |
download | cpython-8fc4a916658aa4a24f29a6e1b438f910465cc22b.zip cpython-8fc4a916658aa4a24f29a6e1b438f910465cc22b.tar.gz cpython-8fc4a916658aa4a24f29a6e1b438f910465cc22b.tar.bz2 |
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).
Diffstat (limited to 'Doc')
0 files changed, 0 insertions, 0 deletions