8000 bpo-12029: [doc] clarify that except does not match virtual subclasses of the specified exception type by iritkatriel · Pull Request #32027 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-12029: [doc] clarify that except does not match virtual subclasses of the specified exception type #32027

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Mar 21, 2022
Next Next commit
bpo-12029: [doc] clarify that except does not match virtual subclasse…
…s of the specified exception type
  • Loading branch information
iritkatriel committed Mar 21, 2022
commit 39af31b2d7576793e42616c0eee2ca4fb74d47f6
6 changes: 3 additions & 3 deletions Doc/tutorial/errors.rst
9299
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ may name multiple exceptions as a parenthesized tuple, for example::
... pass

A class in an :keyword:`except` clause is compatible with an exception if it is
the same class or a base class thereof (but not the other way around --- an
*except clause* listing a derived class is not compatible with a base class).
For example, the following code will print B, C, D in that order::
the same class or a non-virtual base class thereof (but not the other way around
--- an *except clause* listing a derived class is not compatible with a base
class). For example, the following code will print B, C, D in that order::

class B(Exception):
pass
Expand Down
0