Michael >>
>> Does Python 2.4 support it?
> 
> Not precisely, but you can *usually* get away with:
> 
> a and b or c

This is really bad advice, as long as you don't explain why it "usually"
works (and often enough not). This for example won't work:

>>> False or '' and 0
''

The reason is that the if-value has to be bool(v) == True, otherwise the
short-circuiting of the and will prevent the 0 from being returned.

So in general, _don't_ use this!

Diez
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to