Issue29650
Created on 2017-02-25 16:46 by chrysn, last changed 2022-04-11 14:58 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| demo.py | chrysn, 2017-02-25 16:46 | demo that should throw TypeError | ||
| Messages (2) | |||
|---|---|---|---|
| msg288571 - (view) | Author: chrysn (chrysn) * | Date: 2017-02-25 16:46 | |
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. |
|||
| msg288590 - (view) | Author: Xiang Zhang (xiang.zhang) * ![]() |
Date: 2017-02-26 07:49 | |
Yes. This is the case for builtin types which usually get their own __new__ methods. See #5996. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:43 | admin | set | github: 73836 |
| 2017-02-26 08:06:38 | serhiy.storchaka | set | status: open -> closed superseder: abstract class instantiable when subclassing built-in types dependencies: - abstract class instantiable when subclassing built-in types resolution: duplicate stage: resolved |
| 2017-02-26 07:49:41 | xiang.zhang | set | versions:
+ Python 3.5, Python 3.7 nosy: + xiang.zhang messages: + msg288590 dependencies: + abstract class instantiable when subclassing built-in types |
| 2017-02-25 16:46:46 | chrysn | create | |
