bpo-12029: [doc] clarify that except does not match virtual subclasse… · python/cpython@45833b5 (original) (raw)

Original file line number Diff line number Diff line change
@@ -243,9 +243,10 @@ is found that matches the exception. An expression-less except clause, if
243 243 present, must be last; it matches any exception. For an except clause with an
244 244 expression, that expression is evaluated, and the clause matches the exception
245 245 if the resulting object is "compatible" with the exception. An object is
246 -compatible with an exception if the object is the class or a base class of the exception
247 -object, or a tuple containing an item that is the class or a base class of
248 -the exception object.
246 +compatible with an exception if the object is the class or a
247 +:term:`non-virtual base class ` of the exception object,
248 +or a tuple containing an item that is the class or a non-virtual base class
249 +of the exception object.
249 250
250 251 If no except clause matches the exception, the search for an exception handler
251 252 continues in the surrounding code and on the invocation stack. [#]_