Skip to content

Commit ede96d5

Browse files
committed
fix lint errors
1 parent bc0cbf5 commit ede96d5

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

peps/pep-0765.rst

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -160,41 +160,41 @@ Rejected Ideas
160160
Emit `SyntaxError` in CPython
161161
-----------------------------
162162

163-
:pep:`601` proposed that CPython would emit `SyntaxWarning` for a couple of
164-
releases and `SyntaxError` afterwards. We are leaving it open whether, and
165-
when, this will become a `SyntaxError` in CPython, because we believe that a
166-
`SyntaxWarning` would give most of the benefit with less risk.
163+
:pep:`601` proposed that CPython would emit ``SyntaxWarning`` for a couple of
164+
releases and ``SyntaxError`` afterwards. We are leaving it open whether, and
165+
when, this will become a ``SyntaxError`` in CPython, because we believe that a
166+
``SyntaxWarning`` would provide most of the benefit with less risk.
167167

168168
Change Semantics
169169
----------------
170170

171171
It `was suggested <https://discuss.python.org/t/pep-765-disallow-return-break-continue-that-exit-a-finally-block/71348/32>`__
172172
to change the semantics of control flow instruction in finally such that an
173-
in-flight exception takes precedence over them. In other words, a `return`,
174-
`break` or `continue` would be permitted, and would exit the `finally` block,
175-
but the exception would still be raised.
173+
in-flight exception takes precedence over them. In other words, a ``return``,
174+
``break`` or ``continue`` would be permitted, and would exit the ``finally``
175+
block, but the exception would still be raised.
176176

177177
This was rejected for two reasons. First, it would change the semantics of
178-
working code in a way that can be hard to debug: a `finally` that was written
178+
working code in a way that can be hard to debug: a ``finally`` that was written
179179
with the intention of swallowing all exceptions (correctly using the documented
180180
semantics) would now allow the exception to propagate on. This may happen only
181181
in rare edge cases at runtime, and is not guaranteed to be detected in testing.
182182
Even if the code is wrong, and has an exception swallowing bug, it could be
183183
hard for users to understand why a program started raising exceptions in 3.14,
184184
while it did not in 3.13.
185-
In contrast, a `SyntaxError` is likely to be seen during testing, it would
185+
In contrast, a ``SyntaxError`` is likely to be seen during testing, it would
186186
point to the precise location of the problem in the code, and it would not
187187
prevent the program from running.
188188

189189
The second objection was about the proposed semantics. The motivation for
190190
allowing control flow statements is not that this would be useful, but rather
191191
the desire for orthogonality of features (which, as we mentioned in the
192-
introduction, is already violated in the case of `except*` clauses). However,
193-
the proposed semantics are complicated because they suggest that `return`,
194-
`break` and `continue` behave as they normally when finally is called without
195-
an in-flight exception, but turn into something like a bare `raise` when there
196-
is one. It is hard to claim that the features are orthogonal if the presence
197-
of one changes the semantics of the other.
192+
introduction, is already violated in the case of ``except*`` clauses). However,
193+
the proposed semantics are complicated because they suggest that ``return``,
194+
``break`` and ``continue`` behave as they normally when finally is called
195+
without an in-flight exception, but turn into something like a bare ``raise``
196+
when there is one. It is hard to claim that the features are orthogonal if
197+
the presence of one changes the semantics of the other.
198198

199199
Copyright
200200
=========

0 commit comments

Comments
 (0)