On Fri, Jun 4, 2010 at 1:23 PM, Dave Angel <da...@ieee.org> wrote:
>
> I'd prefer the form:
>
>  flag = not not (someValue or another)
>

That's a construct you might commonly find in languages like C, but I
don't think it's very pythonic. If you want to convert your result to
a bool, be explicit about it:

flag = bool(some_value or another)

I'd agree that the if/else construct is redundant if you just want a
True/False result, but the double not is a kind of implicit type
conversion that is easily avoided.

Hugo
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to