On Dec 20, 2007 8:16 AM, Realazy XA Chen <[EMAIL PROTECTED]> wrote: > > > On Dec 20, 3:25 am, "Gary Bernhardt" <[EMAIL PROTECTED]> wrote: > > Like most questions about IterBetter, the solution to this one is to > > turn it into a list: > > > > my_list = list(my_iter) > > if my_list: > > do_stuff_with(my_list) > > else: > > print 'empty!' > > thanks you, Gary! > > but, is it an efficient way to do that when the iterbetter object > contain large amount of items?
If I remember correctly, __len__ function is added to result for all databases except sqlite. So bool(result) works without iterating through the entire result. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web.py" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/webpy?hl=en -~----------~----~----~----~------~----~------~--~---
