Yurii Karabas <1998uri...@gmail.com> added the comment:

When I work with ABC classes usually I faced a problem -  I forget to implement 
one of the methods or make a typo in the method name. In such case I will know 
about it only when I will try to instantiate a class.

In case when a hierarchy is big you should go through classes and find the 
exact class where the problem is.

With this feature, in a case when a class inherits from strict ABC and doesn't 
implement all abstract methods of strict classes it will fail at class 
declaration rather than at instance creation as with regular ABC classes.

As an option, I can run mypy every time before start the python interpreter.

The perfect behavior for me is a case when ABC class will be strict by default, 
but it will break the existing code.

Examples to explain the idea:
```
from abc import ABC, abstractmethod

class Base(ABC):
    @abstraabstractmethod
    def foo(self):
         pass

class A(Base, ABC):  # totally okay, because class directly inherits from ABC
     pass

class B(Base):  # will fail, because class doesn't implement foo method
    pass
```

Raymond, could you please explain why the current behavior is default.

----------

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

Reply via email to