Checking if elements are empty

Wildemar Wildenburger lasses_weil at klapptsowieso.net
Fri Sep 7 05:12:05 EDT 2007


Lawrence D'Oliveiro wrote:
> In message <mailman.93.1189003016.2658.python-list at python.org>, Chris Mellon
> wrote:
> 
>> On 9/5/07, Steve Holden <steve at holdenweb.com> wrote:
>>> Doran, Harold wrote:
>>>> Is there a way to check if the first element of y is null?
>>>>
>>> len(y[0]) == 0
>>>
>> Better spelled as
>>
>> if y[0]:
> 
> Not a good idea.

Why not?

/W



More information about the Python-list mailing list