diff options
Diffstat (limited to 'Doc/reference/expressions.rst')
-rw-r--r-- | Doc/reference/expressions.rst | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst index 17f1f2c..33f7575 100644 --- a/Doc/reference/expressions.rst +++ b/Doc/reference/expressions.rst @@ -1055,7 +1055,7 @@ The power operator binds more tightly than unary operators on its left; it binds less tightly than unary operators on its right. The syntax is: .. productionlist:: - power: ( `await_expr` | `primary` ) ["**" `u_expr`] + power: (`await_expr` | `primary`) ["**" `u_expr`] 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 @@ -1127,7 +1127,7 @@ operators and one for additive operators: .. productionlist:: m_expr: `u_expr` | `m_expr` "*" `u_expr` | `m_expr` "@" `m_expr` | - : `m_expr` "//" `u_expr`| `m_expr` "/" `u_expr` | + : `m_expr` "//" `u_expr` | `m_expr` "/" `u_expr` | : `m_expr` "%" `u_expr` a_expr: `m_expr` | `a_expr` "+" `m_expr` | `a_expr` "-" `m_expr` @@ -1207,7 +1207,7 @@ Shifting operations The shifting operations have lower priority than the arithmetic operations: .. productionlist:: - shift_expr: `a_expr` | `shift_expr` ( "<<" | ">>" ) `a_expr` + shift_expr: `a_expr` | `shift_expr` ("<<" | ">>") `a_expr` These operators accept integers as arguments. They shift the first argument to the left or right by the number of bits given by the second argument. @@ -1267,7 +1267,7 @@ C, expressions like ``a < b < c`` have the interpretation that is conventional in mathematics: .. productionlist:: - comparison: `or_expr` ( `comp_operator` `or_expr` )* + comparison: `or_expr` (`comp_operator` `or_expr`)* comp_operator: "<" | ">" | "==" | ">=" | "<=" | "!=" : | "is" ["not"] | ["not"] "in" @@ -1631,9 +1631,9 @@ Expression lists .. index:: pair: expression; list .. productionlist:: - expression_list: `expression` ( "," `expression` )* [","] - starred_list: `starred_item` ( "," `starred_item` )* [","] - starred_expression: `expression` | ( `starred_item` "," )* [`starred_item`] + expression_list: `expression` ("," `expression`)* [","] + starred_list: `starred_item` ("," `starred_item`)* [","] + starred_expression: `expression` | (`starred_item` ",")* [`starred_item`] starred_item: `expression` | "*" `or_expr` .. index:: object: tuple |