Conditional expressions - PEP 308

Ziga Seilnacht ziga.seilnacht at gmail.com
Wed Jan 31 11:50:57 EST 2007


Colin J. Williams wrote:
> It would be helpful if the rules of the game were spelled out more clearly.
>
> The conditional expression is defined as X if C else Y.
> We don't know the precedence of the "if" operator.  From the little test
> below, it seem to have a lower precedence than "or".

The rules are specified in the Python Reference Manual:
http://docs.python.org/ref/Booleans.html

Ziga




More information about the Python-list mailing list