On 5/6/2011 7:34 AM, James Mills wrote:
On Fri, May 6, 2011 at 4:36 PM, Jabba Laci<jabba.l...@gmail.com>  wrote:
If I want to check if a list is empty, which is the more pythonic way?

[...]

(2) if not li:

This is fine.

This is the intended way. Anything in addition is extra noise and wasted calculation. In other words, let Python do the boilerplate work for you.

--
Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to