"except" and "subclasscheck" changed between CPython2 and 3

2018-03-06 Thread Youta TAKAOKA
Thank you, Steven. > There is a feature-request to support that (as Python 2.7 does): > > https://bugs.python.org/issue12029 > > but it is stalled. I passed over the ticket. Now, I know that this is a bug, but has not fixed yet. There are (or ware ?) problems about performance and integrity for

Re: "except" and "subclasscheck" changed between CPython2 and 3

2018-03-05 Thread Steven D'Aprano
On Sat, 03 Mar 2018 04:28:24 +, 高岡陽太 wrote: > Hello, > > I found a difference of behavior about `except` statement between > CPython 2.7 and 3.x . > `except EXC_CLASS:` calls `__subclasscheck__` in 2.7, but does not in > 3.x . Python 3 does not accept virtual subclasses for exception handli

"except" and "subclasscheck" changed between CPython2 and 3

2018-03-03 Thread 高岡陽太
Hello, I found a difference of behavior about `except` statement between CPython 2.7 and 3.x . `except EXC_CLASS:` calls `__subclasscheck__` in 2.7, but does not in 3.x . Let me show you an example. Now, define a class "ExceptionLike" (with metaclass "ExceptionLikeMeta") below. class ExceptionL