cpython/Doc/reference
Miss Islington (bot) 409ce4a09e
bpo-42669: Document that except rejects nested tuples (GH-23822) (GH-23870)
In Python 2, it was possible to use `except` with a nested tuple, and occasionally natural.  For example, `zope.formlib.interfaces.InputErrors` is a tuple of several exception classes, and one might reasonably think to do something like this:

    try:
        self.getInputValue()
        return True
    except (InputErrors, SomethingElse):
        return False

As of Python 3.0, this raises `TypeError: catching classes that do not inherit from BaseException is not allowed` instead: one must instead either break it up into multiple `except` clauses or flatten the tuple.  However, the reference documentation was never updated to match this new restriction.  Make it clear that the definition is no longer recursive.

Automerge-Triggered-By: GH:ericvsmith
(cherry picked from commit c95f8bc270)

Co-authored-by: Colin Watson <cjwatson@debian.org>

Co-authored-by: Colin Watson <cjwatson@debian.org>
2020-12-20 16:18:08 -05:00
..
compound_stmts.rst bpo-42669: Document that except rejects nested tuples (GH-23822) (GH-23870) 2020-12-20 16:18:08 -05:00
datamodel.rst bpo-6761: Enhance __call__ documentation (GH-7987) 2020-10-27 09:42:36 -07:00
executionmodel.rst Doc: Add -m reference in context of code execution (GH-16045) 2019-09-12 14:19:06 +01:00
expressions.rst bpo-42198: Link to GenericAlias in typing and expressions (GH-23030) 2020-10-29 21:23:33 -07:00
grammar.rst [3.9] bpo-40939: Use the new grammar for the grammar specification documentation (GH-19969) (#21641) 2020-07-27 12:00:42 -07:00
import.rst bpo-35181: Correct importlib documentation for some module attributes (GH-15190) 2020-10-21 14:39:41 -07:00
index.rst
introduction.rst bpo-41762: Fix usage of productionlist markup in the doc (GH-22281) 2020-09-18 00:27:21 -07:00
lexical_analysis.rst bpo-41762: Fix usage of productionlist markup in the doc (GH-22281) 2020-09-18 00:27:21 -07:00
simple_stmts.rst Doc: Remove old Python version from future stmt (GH-21802) 2020-10-20 23:06:29 -07:00
toplevel_components.rst bpo-41762: Fix usage of productionlist markup in the doc (GH-22281) 2020-09-18 00:27:21 -07:00