On Mon, Oct 19, 2009 at 3:29 AM, Wayne <[email protected]> wrote: > Hi, I think I recall seeing this here, but I wanted to make sure I'm > correct. > Is the best way to test for an empty list just test for the truth value? > I.e. > mylist = [1,2,3] > while mylist: > print mylist.pop()
Whether it is the 'best' way depends on what you mean by 'best', but I do think it's the most idiomatically pythonic one. -- André Engels, [email protected] _______________________________________________ Tutor maillist - [email protected] To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor
