Skip to content

Commit

Permalink
apply Alissa's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
iritkatriel committed Nov 15, 2024
1 parent 5ba270a commit 66238e1
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions peps/pep-9999.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
PEP: 9999
Title: Disallow return/break/continue that exit a finally block
Author: Alyssa Coghlan <ncoghlan at gmail.com> and Irit Katriel <irit at python.org>
Author: Irit Katriel <irit at python.org>, Alyssa Coghlan <ncoghlan at gmail.com>
Discussions-To: https://discuss.python.org/t/an-analysis-of-return-in-finally-in-the-wild/70633
Status: Draft
Type: Standards Track
Created: 14-Nov-2024
Post-History:
Created: 15-Nov-2024
Post-History: 15-Nov-2024

.. highlight:: rst

Expand Down Expand Up @@ -41,7 +42,7 @@ In 2019, :pep:`601` proposed to change Python to emit a
``SyntaxWarning`` for a few releases and then turn it into a
``SyntaxError``. It was rejected in favour of viewing this
as a programming style issue, to be handled by linters and :pep:`8`.
Indeed, :pep:`8` now recommends not to used control flow statements
Indeed, :pep:`8` now recommends not to use control flow statements
in a ``finally`` block, and linters such as pylint [2]_, ruff [3]_
and flake8-bugbear [4]_ flag them as a problem.

Expand Down Expand Up @@ -92,7 +93,7 @@ This includes the following examples:
try:
...
finally:
break (or continue)
break # (or continue)
But excludes these:

Expand All @@ -108,7 +109,7 @@ But excludes these:
...
finally:
for x in o:
break (or continue)
break # (or continue)
CPython will emit a ``SyntaxWarning`` in version 3.14, and we leave
Expand Down

0 comments on commit 66238e1

Please sign in to comment.