Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-95975: Move except/*/finally ref labels to more precise locations#95976

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Merged
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
NextNext commit
gh-95975: Move except/*/finally ref labels to more precise locations
  • Loading branch information
@CAM-Gerlach
CAM-Gerlach committedAug 14, 2022
commitf741f38fbcc5347617b977fb0b050e080c46b453
11 changes: 8 additions & 3 deletionsDoc/reference/compound_stmts.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -199,10 +199,8 @@ returns the list ``[0, 1, 2]``.
.. versionchanged:: 3.11
Starred elements are now allowed in the expression list.


.. _try:
.. _except:
.. _except_star:
.. _finally:

The :keyword:`!try` statement
=============================
Expand DownExpand Up@@ -231,6 +229,7 @@ for a group of statements:
try3_stmt: "try" ":" `suite`
: "finally" ":" `suite`

.. _except:

The :keyword:`except` clause(s) specify one or more exception handlers. When no
exception occurs in the :keyword:`try` clause, no exception handler is executed.
Expand DownExpand Up@@ -315,6 +314,8 @@ when leaving an exception handler::
.. index::
keyword: except_star

.. _except_star:

The :keyword:`except*<except_star>` clause(s) are used for handling
:exc:`ExceptionGroup`\ s. The exception type for matching is interpreted as in
the case of :keyword:`except`, but in the case of exception groups we can have
Expand DownExpand Up@@ -359,6 +360,8 @@ one except* clause, the first that matches it. ::
statement: break
statement: continue

.. _except_else:

The optional :keyword:`!else` clause is executed if the control flow leaves the
:keyword:`try` suite, no exception was raised, and no :keyword:`return`,
:keyword:`continue`, or :keyword:`break` statement was executed. Exceptions in
Expand All@@ -367,6 +370,8 @@ clauses.

.. index:: keyword: finally

.. _finally:

If :keyword:`finally` is present, it specifies a 'cleanup' handler. The
:keyword:`try` clause is executed, including any :keyword:`except` and
:keyword:`!else` clauses. If an exception occurs in any of the clauses and is
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp