What way is the best to check an empty list?

andrew cooke andrew at acooke.org
Wed Mar 25 22:48:07 CET 2009


Martin P. Hellwig wrote:
> Raymond Hettinger wrote:
>> On Mar 25, 7:38 am, srinivasan srinivas <sri_anna... at yahoo.co.in>
>> wrote:
>>> if not A:
>> PEP 8 recommends the latter.
> I can't seem to find where this recommendation is mentioned or implied.

it's the next-to-last sub-item, just before the references.
http://www.python.org/dev/peps/pep-0008/

andrew




More information about the Python-list mailing list