DEV Community


Discussion on: A Pythonic Guide to SOLID Design Principles

bshorrosh profile image

How about adding @abc.abstractmethod to the abstract methods, which will enforce the implementation in the concrete class.

ezzy1337 profile image
Derek D. Author

I debated using abc to enforce the implementations and went as far as to explain the Dreaded Diamond problem in C# and Java and how interfaces solve the problem in my first iteration of this article. In the end, I chose not to use abc so it wouldn't confuse readers users into thinking @abc.abstractmethod were required for ISP.

I personally do use them and would recommend them, especially while teaching the principle to others.