Consider the following code snippet:
import abc
class Base(abc.ABC):
@abc.abstractmethod
def foo(self):
pass
class WithAbstract(Base, abc.ABC):
@abc.abstractmethod
def bar(self):
pass
class WithoutAbstract(Base):
@abc.abstractmethod
def bar(self):
pass
I have two questions regarding the code above:
- Is it necessary to inherit
WithAbstract
fromabc.ABC
as well, or is it sufficient to inheritWithoutAbstract
only fromBase
? - What is the pythonic way of going about it? What is the best practice?