diff options
Diffstat (limited to 'Doc/reference/expressions.rst')
-rw-r--r-- | Doc/reference/expressions.rst | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst index 476c82df4b..ef71a80f14 100644 --- a/Doc/reference/expressions.rst +++ b/Doc/reference/expressions.rst @@ -741,7 +741,7 @@ less tightly than unary operators on its right. The syntax is: Thus, in an unparenthesized sequence of power and unary operators, the operators are evaluated from right to left (this does not constrain the evaluation order -for the operands). +for the operands): ``-1**2`` results in ``-1``. The power operator has the same semantics as the built-in :func:`pow` function, when called with two arguments: it yields its left argument raised to the power @@ -959,12 +959,12 @@ Comparisons can be chained arbitrarily, e.g., ``x < y <= z`` is equivalent to ``x < y and y <= z``, except that ``y`` is evaluated only once (but in both cases ``z`` is not evaluated at all when ``x < y`` is found to be false). -Formally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *opa*, *opb*, ..., -*opy* are comparison operators, then *a opa b opb c* ...*y opy z* is equivalent -to *a opa b* :keyword:`and` *b opb c* :keyword:`and` ... *y opy z*, except that -each expression is evaluated at most once. +Formally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*, *op2*, ..., +*opN* are comparison operators, then ``a op1 b op2 c ... y opN z`` is equivalent +to ``a op1 b and b op2 c and ... y opN z``, except that each expression is +evaluated at most once. -Note that *a opa b opb c* doesn't imply any kind of comparison between *a* and +Note that ``a op1 b op2 c`` doesn't imply any kind of comparison between *a* and *c*, so that, e.g., ``x < y > z`` is perfectly legal (though perhaps not pretty). |