From b5e5013378a6c6153a33ca34f6a00ef4ccd54e0c Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Fri, 13 Mar 2026 11:12:02 +0100 Subject: [PATCH] [3.14] Docs: except with multiple exceptions parentheses not required (GH-145848) (#145904) 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 6d1e9ceed3e70ebc39953f5ad4f20702ffa32119) See: https://peps.python.org/pep-0758/ Co-authored-by: Maurizio Sambati --- Doc/tutorial/errors.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/tutorial/errors.rst b/Doc/tutorial/errors.rst index 1c20fa2f0b6a..ae21dfdbf0ac 100644 --- a/Doc/tutorial/errors.rst +++ b/Doc/tutorial/errors.rst @@ -121,9 +121,9 @@ A :keyword:`try` statement may have more than one *except clause*, to specify handlers for different exceptions. At most one handler will be executed. Handlers only handle exceptions that occur in the corresponding *try clause*, not in other handlers of the same :keyword:`!try` statement. An *except clause* -may name multiple exceptions as a parenthesized tuple, for example:: +may name multiple exceptions, for example:: - ... except (RuntimeError, TypeError, NameError): + ... except RuntimeError, TypeError, NameError: ... pass A class in an :keyword:`except` clause matches exceptions which are instances of the -- 2.47.3