On 27 May 2010 22:22, HH <henri...@gmail.com> wrote:

>    if (width == 0 and
>        height == 0 and
>        color == 'red' and
>        emphasis == 'strong' or
>        highlight > 100):
>        raise ValueError("sorry, you lose")
>

I've gotta say - I've bumped into this problem before, and I'm sure many
other have - this is a valid question. It just hasn't bothered me enough to
ask...

Correct me if I'm wrong, but I think the following is equivalent, and looks
better. Although this won't fix all ugly cases in that problem.

if (width, height, color, emphasis) == (0, 0, 'red', 'strong') or highlight
> 100:
    raise ValueError("sorry, you lose")

Cheers,
Xav
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to