Hi!
suppose I want to create an abstract class in python with some methods to be implemented by subclasses. (in Python)
for example:
class Base():
def f(self):
print "Hello."
self.g()
print "Bye!"
class A(Base):
def g(self):
print "I am A"
class B(Base):
def g(self):
print "I am B"
I'd like that if the base class is instantiated and its f() method called, when g() is called, an exception to raise, informing that a subclass should have implemented method g().
What's the usual thing to do here? Should I raise a NotImplementedError? or is there a more specific way of doing it?
Thanks a lot!
Manuel