>> I prefer to write it explicitly: >> >> if len(lst) > 0: >> ... > > At the very least, IMO you should write this as > > if len(lst): > ... > > There's no reason to be explicit about the numeric comparison.
I think in the mind-set that dislikes relying on boolean conversion of lists, relying on boolean conversion of numbers is just as evil. In this mindset (IIUC), you *have* to have an expression that is either True or False in a boolean test (if and while). Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list