8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent af034dd commit e46fd72Copy full SHA for e46fd72
Doc/tutorial/errors.rst
@@ -119,9 +119,9 @@ may name multiple exceptions as a parenthesized tuple, for example::
119
... except (RuntimeError, TypeError, NameError):
120
... pass
121
122
-A class in an :keyword:`except` clause is compatible with an exception if it is
123
-the same class or a base class thereof (but not the other way around --- an
124
-*except clause* listing a derived class is not compatible with a base class).
+A class in an :keyword:`except` clause matches exceptions which are instances of the
+class itself or one of its derived classes (but not the other way around --- an
+*except clause* listing a derived class does not match instances of its base classes).
125
For example, the following code will print B, C, D in that order::
126
127
class B(Exception):
0 commit comments