[New-bugs-announce] [issue29650] abstractmethod does not work when deriving from Exception

chrysn report at bugs.python.org
Sat Feb 25 11:46:46 EST 2017


New submission from chrysn:

The "TypeError: Can't instantiate abstract class C with abstract methods x" exception does not get raised when when the involved ABCMeta class is derived from an Exception.

The attached file shows that a class without an implementation of an abstractmethod can get instanciated; replacing the derivation from Exception with a derivation from another class (say, A) makes the instanciation throw the proper TypeError.

----------
files: demo.py
messages: 288571
nosy: chrysn
priority: normal
severity: normal
status: open
title: abstractmethod does not work when deriving from Exception
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file46668/demo.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29650>
_______________________________________


More information about the New-bugs-announce mailing list