while (assignment):

Sybren Stuvel sybrenUSE at YOURthirdtower.imagination.com
Wed Jul 30 08:43:31 CEST 2003

John Roth enlightened us with:
> For most purposes, there is. Just use a for loop!  As long as the
> source behaves like an iterator, the for loop will automatically
> assign each result.

How's that for performance? I guess I'll have to take a look at the
MySQLdb package source code to see how the resultset code functions. I
hope it calls fetchone() on each call to next() - AFAIK that's more
efficient (let the DB ponder what the next row will be while my
program ponders what to do with the information, and then exchange the
new tuple)

The problem with the world is stupidity. Not saying there should be a
capital punishment for stupidity, but why don't we just take the
safety labels off of everything and let the problem solve itself? 

More information about the Python-list mailing list