how to delete multiple elements from a list

Rainer Deyke root at
Thu Nov 16 01:26:23 CET 2000

"Alex Martelli" <aleaxit at> wrote in message
news:8uuunt015s3 at
> The reallocation costs are amortized by rounding up the
> size (number of items) to a multiple of 10 (of 100, for
> large lists), but that doesn't change the O(N) cost of
> element insertions and deletions (it does change the
> amortized costs by a constant factor of 10, or 100).

I'm curious.  Why multiples of 10 (or 100), and not powers of 2 (or
similar)?  The latter has much better amortized performance for huge lists,
and never wastes more than half of its space.

Rainer Deyke (root at
Shareware computer games           - 
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor

More information about the Python-list mailing list