An abstract class with abc.ABCMeta
as metaclass has abstract methods and is instantiated.
This will result in a TypeError
as Python can't instantiate abstract class with abstract methods.
class BadClass(metaclass=abc.ABCMeta):
@abc.abstractmethod
def test(self):
'''Do nothing.'''
On trying to instantiate this BadClass
, Python will raise: TypeError: Can't instantiate abstract class BadClass with abstract methods test
.
class BadClass(metaclass=abc.ABCMeta):
def test(self):
'''Do nothing.'''