On Thu, Jul 1, 2010 at 12:09 AM, Stef Mientki <stef.mien...@gmail.com>wrote:

>  hello,
>
> I've lot of functions that returns their result in some kind of tuple /
> list / array,
> and if there is no result, these functions return None.
> Now I'm often what to do something if I've more than 1 element in the
> result.
> So I test:
>
>    if len ( Result ) > 1 :
>
> But to prevent exceptions, i've to write ( I often forget)
>     if Result and ( len ( Result ) > 1 ) :
>

use
if Result:
   <do something>

Checking the length would be a bad idea.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to