Andrei Kulakov <andrei....@gmail.com> added the comment:

Ethan, here  is the code I tried with 3.9, and the failure:

import abc
class Base(abc.ABC):
    def __init_subclass__(cls, **kwargs):
        instance = cls()
        print(f"Created instance of {cls} easily: {instance}")
    @abc.abstractmethod
    def do_something(self):
        pass
class Derived(Base):
    pass
Derived()

Output:
python3 ~/temp/a.py                                                             
                                                                                
           ----VICMD----
Traceback (most recent call last):
  File "/Users/ak/temp/a.py", line 53, in <module>
    Derived()
TypeError: Can't instantiate abstract class Derived with abstract method 
do_something

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35815>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to