Message136717
Surveying the docs, the current behavior *is* /technically/ correct (in a suspiciously precise way) according to the Language Reference:
http://docs.python.org/dev/reference/compound_stmts.html#grammar-token-try_stmt :
"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:
http://docs.python.org/dev/tutorial/errors.html#handling-exceptions :
"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:08 | cvrebert | set | recipients:
+ cvrebert, acooke, eric.araujo, daniel.urban |
2011-05-24 02:45:08 | cvrebert | set | messageid: <1306205108.69.0.954360202278.issue12029@psf.upfronthosting.co.za> |
2011-05-24 02:45:08 | cvrebert | link | issue12029 messages |
2011-05-24 02:45:07 | cvrebert | create | |
|