Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #58258 > unrolled thread
| Started by | Chris Angelico <rosuav@gmail.com> |
|---|---|
| First post | 2013-11-01 22:55 +1100 |
| Last post | 2013-11-01 20:09 +0000 |
| Articles | 2 — 2 participants |
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.
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
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2013-11-01 22:55 +1100 |
| Subject | Re: "Backward"-Iterator - Beginners question |
| Message-ID | <mailman.1920.1383306910.18130.python-list@python.org> |
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
[toc] | [next] | [standalone]
| From | patrick vrijlandt <patrick.vrijlandt@gmail.com> |
|---|---|
| Date | 2013-11-01 20:09 +0000 |
| Message-ID | <40007371405028839.607061patrick.vrijlandt-gmail.com@newszilla.xs4all.nl> |
| In reply to | #58258 |
Chris Angelico <rosuav@gmail.com> wrote: > 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. Well, if you want to iterate over a SQL result backwards, I would seriously consider modifying the SELECT to yield the results in the right order. That would avoid keeping the list in memory and makes best use of the database. -- patrick
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web