Conditional expressions - PEP 308

Ziga Seilnacht ziga.seilnacht at
Wed Jan 31 17:50:57 CET 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:


More information about the Python-list mailing list