So, I am trying to define an abstract base class with couple of variables which I want to to make it mandatory to have for any class which "inherits" this base class.. So, something like:
class AbstractBaseClass(object):
foo = NotImplemented
bar = NotImplemented
Now,
class ConcreteClass(AbstractBaseClass):
# here I want the developer to force create the class variables foo and bar:
def __init__(self...):
self.foo = 'foo'
self.bar = 'bar'
This should throw error:
class ConcreteClass(AbstractBaseClass):
# here I want the developer to force create the class variables foo and bar:
def __init__(self...):
self.foo = 'foo'
#error because bar is missing??
I maybe using the wrong terminology.. but basically, I want every developer who is "implementing" the above class to force to define these variables??
abcprovides for abstract properties (which might be applicable here) and abstract methods, not general instance variables.