mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
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
|
||
|---|---|---|
| .. | ||
| compound_stmts.rst | ||
| datamodel.rst | ||
| executionmodel.rst | ||
| expressions.rst | ||
| grammar.rst | ||
| import.rst | ||
| index.rst | ||
| introduction.rst | ||
| lexical_analysis.rst | ||
| simple_stmts.rst | ||
| toplevel_components.rst | ||