Carl Banks a écrit :
> Bruno Desthuilliers wrote:
> 
>>There are less risk of a typo with "if a:" than with "if len(a) > 0".
> 
> 
> So, it's more important to protect against typos than subtle bugs?
> 

People making smart points are really annoying... !-)

wrt/ to the "subtle bug" point, MHO is that a better solution could be 
to have iterators/generators implement __nonzero__ the same way numpy 
arrays do. It may not be a very strong argument, but I actually like the 
fact that empty sequences eval to false just like numeric zeros and None...
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to