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
Prev Previous commit
Next Next commit
Update Doc/reference/compound_stmts.rst
Co-authored-by: Éric <merwok@netwok.org>
  • Loading branch information
iritkatriel and merwok authored Mar 21, 2022
commit 195327b53107b166ae4bfd61db5365111de7f17d
4 changes: 2 additions & 2 deletions Doc/reference/compound_stmts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ present, must be last; it matches any exception. For an except clause with an
expression, that expression is evaluated, and the clause matches the exception
if the resulting object is "compatible" with the exception. An object is
compatible with an exception if the object is the class or a non-virtual base
class of the exception object, or a tuple containing the class or a non-virtual
base class of the exception object.
class of the exception object, or a tuple containing an item that is the class
or a non-virtual base class of the exception object.

If no except clause matches the exception, the search for an exception handler
continues in the surrounding code and on the invocation stack. [#]_
Expand Down
0