[docs] Documentation error for conditional expressions?

Ken Shirriff kens at google.com
Thu Jun 3 06:08:15 CEST 2010


The conditional expression documentation says:

conditional_expression ::=  or_test ["if" or_test "else" expression]

I've stared at this and the PEP, and I''m pretty sure that the first
or_test should be an expression, not an or_test.  In an expression
like "x if C else y", x and y are expressions and C is the or_test.

The documentation in question is at
http://docs.python.org/reference/expressions.html#conditional-expressions

Ken


More information about the docs mailing list