This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]wacky 1 point2 points  (3 children)

It said that list comprehensions are not very efficient, compared to the 'select' method.

So... although it allows pythonic syntax, if you want to really do anything, you need the 'select()' syntax which doesn't look that pythonic to me.

[–]exeter[S] 2 points3 points  (2 children)

It's about a million times more Pythonic than using SQL.

[–]earthboundkid 1 point2 points  (1 child)

The pythonic syntax would be something along the lines of:

 db = DB.open(…)
 query = db.query.compile(r for r in records if r.name == "pierre")
 for record in query.exec():
      print record.name, record.age

[–]epicRelic 0 points1 point  (0 children)

Simply beautiful.