[issue10011] `except` doesn't use `isinstance`

2010-10-08 Thread Terry J. Reedy
Terry J. Reedy added the comment: Questions should be asked on python-list or other discussion forums, not nere. If this were a feature-request, it would need a realistic use-case. If the implied change were requested, I would think it should be rejected as conflicting with the language defin

[issue10011] `except` doesn't use `isinstance`

2010-10-02 Thread Benjamin Peterson
Benjamin Peterson added the comment: It matters when exceptions are expected or are a normal part of control flow. For example StopIteration. -- nosy: +benjamin.peterson ___ Python tracker ___

[issue10011] `except` doesn't use `isinstance`

2010-10-02 Thread Ram Rachum
Ram Rachum added the comment: Also, how important is the performance of exception checking *after* an exception was raised? I mean, wouldn't it matter only for programs that raise and catch hundreds of exceptions a second? -- ___ Python tracker

[issue10011] `except` doesn't use `isinstance`

2010-10-01 Thread Ram Rachum
Ram Rachum added the comment: I don't understand the infinite recursion argument. If there's such an infinite recursion, wouldn't it be due to a bug in the user's implementation of __instancecheck__? -- ___ Python tracker

[issue10011] `except` doesn't use `isinstance`

2010-10-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: Mainly to protect against potential infinite recursion with isinstance checks. Also, performance is probably better. Here are the relevant code and comments in PyErr_GivenExceptionMatches() (in Python/errors.c): /* PyObject_IsSubclass() can recurse a

[issue10011] `except` doesn't use `isinstance`

2010-10-01 Thread Ram Rachum
New submission from Ram Rachum : Is there a reason why `execpt` compares base classes instead of using `isinstance`? This prevents using `__instancecheck__` to override the instance check. -- components: Interpreter Core messages: 117844 nosy: cool-RR priority: normal severity: normal