diff --git a/pep-3110.txt b/pep-3110.txt index 3e6ad781f..4f4cc4930 100644 --- a/pep-3110.txt +++ b/pep-3110.txt @@ -83,7 +83,7 @@ to :: The use of ``as`` in place of the comma token means that :: - except AttributeError, os.error: + except (AttributeError, os.error): can be clearly understood as a tuple of exception classes. This new syntax was first proposed by Greg Ewing [#firstproposal]_ and @@ -93,6 +93,14 @@ Further, the restriction of the token following ``as`` from ``test`` to ``NAME`` means that only valid identifiers can be used as ``except`` targets. +Note that the grammar above always requires parenthesized tuples as +exception clases. That way, the ambiguous :: + + except A, B: + +which would mean different things in Python 2.x and 3.x -- leading to +hard-to-catch bugs -- cannot legally occur in 3.x code. + Semantic Changes ================