Skip to content

Commit 2b33811

Browse files
authored
Docs: except with multiple exceptions parentheses not required
As of PEP 758 the except statement doesn't require parentheses anymore for exception tuples. See: https://peps.python.org/pep-0758/
1 parent 7245630 commit 2b33811

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 as a tuple, 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)