I would implement say_hello()
as a stub:
class Base(object):
# ...as above...
def say_hello(self):
raise NotImplementedError
Alternatively, put only pass in the body of say_hello()
.
This would also signal to the user of your Base
class that say_hello()
should be implemented before she gets an AttributeError when calling obj.hello()
.
Whether to raise an Exception or to pass
depends on whether doing nothing is sensible default behaviour. If you require the user to supply her own method, raise an exception.