Checking if elements are empty

Wildemar Wildenburger lasses_weil at klapptsowieso.net
Fri Sep 7 21:56:10 EDT 2007


Lawrence D'Oliveiro wrote:
>>>> if y[0]:
>>> Not a good idea.
>> Why not?
> 
> Because there is a situation where your version of the test will fail even
> if the first element of y is non-null.

Such as? Seriously people, a little more verbosity wouldn't hurt here. 
This isn't a mystery game.

/W



More information about the Python-list mailing list