Skip to content

Commit 8beb707

Browse files
committed
Revised the examples for evaluation order to ensure consistent formatting.
1 parent a285684 commit 8beb707

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

‎Doc/reference/expressions.rst‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1921,17 +1921,19 @@ Following is an example of right to left conditional_expression evaluation examp
19211921
.. code-block:: python
19221922
19231923
'foo' if 1 else 'bar' if 0 else 'baz'
1924-
' foo'
1924+
'foo'
19251925
19261926
In the following lines, expressions will be evaluated in the arithmetic order of
1927-
their suffixes::
1928-
1929-
expr1, expr2, expr3, expr4
1930-
(expr1, expr2, expr3, expr4)
1931-
{expr1: expr2, expr3: expr4}
1932-
expr1 + expr2 * (expr3 - expr4)
1933-
expr1(expr2, expr3, *expr4, **expr5)
1934-
expr3, expr4 = expr1, expr2
1927+
their suffixes:
1928+
1929+
.. code-block:: python
1930+
1931+
expr1, expr2, expr3, expr4
1932+
(expr1, expr2, expr3, expr4)
1933+
{expr1: expr2, expr3: expr4}
1934+
expr1 + expr2 * (expr3 - expr4)
1935+
expr1(expr2, expr3, *expr4, **expr5)
1936+
expr3, expr4 = expr1, expr2
19351937
19361938
19371939
.. _operator-summary:

0 commit comments

Comments
 (0)