In article <mailman.4853.1388763434.18130.python-l...@python.org>,
 Chris Angelico <ros...@gmail.com> wrote:

> Alternatively, if you expect to fill in most of the elements, it's
> possible you'd be happier working with a subclass of list that
> auto-expands by filling in the spare space with a singleton meaning
> "no element here".

And, if you know ahead of time the maximum number of elements you will 
ever have:

x = [None] * max_count

will preallocate them all with a minimum of fuss.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to