This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author cvrebert
Recipients acooke, cvrebert, daniel.urban, eric.araujo
Date 2011-05-24.02:45:07
SpamBayes Score 1.5237797e-08
Marked as misclassified No
Message-id <>
Surveying the docs, the current behavior *is* /technically/ correct (in a suspiciously precise way) according to the Language Reference: :
"For an except clause with an expression [...] the clause matches the exception if the resulting object is 'compatible' with the exception. An object is compatible with an exception if it is the class or a base class of the exception object" (which exactly describes what PyType_IsSubtype() checks for)

The Tutorial is by contrast much more vague: :
"if [the raised exception's] type matches the exception named after the except keyword, the except clause is executed, and then execution continues after the try statement."
No definition of what it means for the types to "match" seems to be given.
Date User Action Args
2011-05-24 02:45:08cvrebertsetrecipients: + cvrebert, acooke, eric.araujo, daniel.urban
2011-05-24 02:45:08cvrebertsetmessageid: <>
2011-05-24 02:45:08cvrebertlinkissue12029 messages
2011-05-24 02:45:07cvrebertcreate