Relative Content

Tag Archive for pythonpython-3.xabstract-class

Abstract Method override in Python

If I create an abstract class in python using abc with an abstractmethod as follows and create a concrete class which doesn’t use def to override the abstractmethod but instead attempt to set the attribute in the init function, it continues to throw the error that we can’t instantiate an abstract class. I found out that I can get around this problem by creating a dummy of the abstractmethod. Is this the recommended way?