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


Groups > comp.lang.python > #58258

Re: "Backward"-Iterator - Beginners question

References <5272CBA8.3070800@fam-goebel.de> <l4uluh$l7s$1@ger.gmane.org> <52737FDF.6080306@fam-goebel.de>
Date 2013-11-01 22:55 +1100
Subject Re: "Backward"-Iterator - Beginners question
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1920.1383306910.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Fri, Nov 1, 2013 at 9:18 PM, Ulrich Goebel <ml@fam-goebel.de> wrote:
> That gives me the solution. What I have, is an iterator object comming as a
> SQLite database cursor object. So I could minimize the underliying SELECT
> and build index = list(cursor). Then with Your hints I get what I want.

Looks good! If you need to iterate over something more than once, or
go back and forth through it a bit, this is probably the best general
solution anyway. With a list, heaps of things are easy, and unless
you're working with gobs of data, you won't have any problems.

ChrisA

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: "Backward"-Iterator - Beginners question Chris Angelico <rosuav@gmail.com> - 2013-11-01 22:55 +1100
  Re: "Backward"-Iterator - Beginners question patrick vrijlandt <patrick.vrijlandt@gmail.com> - 2013-11-01 20:09 +0000

csiph-web