Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
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
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
f741f386a0721db4eca9e5db46b989c69bb84a0209cbe74abFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -199,10 +199,8 @@ returns the list ``[0, 1, 2]``. | ||
| .. versionchanged:: 3.11 | ||
| Starred elements are now allowed in the expression list. | ||
| .. _try: | ||
| The :keyword:`!try` statement | ||
CAM-Gerlach marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| ============================= | ||
| @@ -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 | ||
CAM-Gerlach marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| exception occurs in the :keyword:`try` clause, no exception handler is executed. | ||
| @@ -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 | ||
CAM-Gerlach marked this conversation as resolved. OutdatedShow resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| the case of :keyword:`except`, but in the case of exception groups we can have | ||
| @@ -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 | ||
| @@ -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 | ||