Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #63100 > unrolled thread

Re: Creating a list with holes

Started byDan Stromberg <drsalists@gmail.com>
First post2014-01-03 18:58 -0800
Last post2014-01-03 18:58 -0800
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Creating a list with holes Dan Stromberg <drsalists@gmail.com> - 2014-01-03 18:58 -0800

#63100 — Re: Creating a list with holes

FromDan Stromberg <drsalists@gmail.com>
Date2014-01-03 18:58 -0800
SubjectRe: Creating a list with holes
Message-ID<mailman.4878.1388804309.18130.python-list@python.org>
On Fri, Jan 3, 2014 at 7:37 AM, Chris Angelico <rosuav@gmail.com> wrote:
> Depending on what exactly you need, it's probably worth just using a
> dict. In what ways do you need it to function as a list? You can
> always iterate over sorted(some_dict.keys()) if you need to run
> through them in order.

FWIW, sorting inside a loop is rarely a good idea, unless your lists
are pretty small.

For that, there are many tree datastructures available.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web