Skip to content

Commit a6f03ae

Browse files
duiliomiss-islington
authored andcommitted
Docs: except with multiple exceptions parentheses not required (GH-145848)
As of PEP 758 the except statement doesn't require parentheses anymore for exception tuples. (cherry picked from commit 6d1e9ce) Co-authored-by: Maurizio Sambati <duilio@users.noreply.github.com> See: https://peps.python.org/pep-0758/
1 parent 2af2a38 commit a6f03ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Doc/tutorial/errors.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ A :keyword:`try` statement may have more than one *except clause*, to specify
121121
handlers for different exceptions. At most one handler will be executed.
122122
Handlers only handle exceptions that occur in the corresponding *try clause*,
123123
not in other handlers of the same :keyword:`!try` statement. An *except clause*
124-
may name multiple exceptions as a parenthesized tuple, for example::
124+
may name multiple exceptions, for example::
125125

126-
... except (RuntimeError, TypeError, NameError):
126+
... except RuntimeError, TypeError, NameError:
127127
... pass
128128

129129
A class in an :keyword:`except` clause matches exceptions which are instances of the

0 commit comments

Comments
 (0)