list.pop(0) vs. collections.dequeue

Chris Colbert sccolbert at gmail.com
Mon Jan 25 23:42:38 CET 2010


On Mon, Jan 25, 2010 at 5:09 PM, Steve Howell <showell30 at yahoo.com> wrote:

> On Jan 25, 1:32 pm, Arnaud Delobelle <arno... at googlemail.com> wrote:
> > Steve Howell <showel... at yahoo.com> writes:
> >
> > [...]
> >
> > > My algorithm does exactly N pops and roughly N list accesses, so I
> > > would be going from N*N + N to N + N log N if switched to blist.
> >
> > Can you post your algorithm?  It would be interesting to have a concrete
> > use case to base this discussion on.
> >
>
> I just realized you meant the Python code itself.  It is here:
>
> https://bitbucket.org/showell/shpaml_website/src/tip/shpaml.py
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>


looking at that code, i think you could solve your whole problem with a
single called to reversed() (which is NOT the same as list.reverse())
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100125/8066e235/attachment.html>


More information about the Python-list mailing list