I have read python docs about abstract base classes:
A decorator indicating abstract methods.
Using this decorator requires that the class’s metaclass isor
is derived from it. A class that has a metaclass derived from
cannot be instantiated unless all of its abstract methods and
properties are overridden.
You can apply thedecorator to methods such as draw()
that must be implemented; Python will then raise an exception for
classes that don’t define the method. Note that the exception is only
raised when you actually try to create an instance of a subclass
lacking the method.
__metaclass__ = abc.ABCMeta
self.me = "me"
c = ConcreteClass()
<bound method ConcreteClass.abstractMethod of <__main__.ConcreteClass object at 0x7f694da1c3d0>>
Are you using python3 to run that code ? if yes you should know that declaring metaclass in python 3 have changes you should do it like this instead:
import abc class AbstractClass(metaclass=abc.ABCMeta): @abc.abstractmethod def abstractMethod(self): return