Is there any way I can prevent a child class from overriding a method in the base class?
My guess is that there is not, but I'm coming from the .net world and I'm trying to make my API as robust as possible, so any input is greatly appreciated.
class Parent:
def do_something(self):
'''This is where some seriously important stuff goes on'''
pass
class Child(Parent):
def do_something(self):
'''This should not be allowed.'''
pass
Is it possible to enforce this? I know the compiler won't help, so maybe by means of some runtime check? Or is it just not a pythonian way of going about things?