I have main class as:
class OptionsMenu(object):
def __init__(self, name):
try:
self.menu = getattr(self, name)()
except:
self.menu = None
@staticmethod
def cap():
return ['a', 'b']
and have a child class override as:
class OptionsMenu(OptionsMenu):
@staticmethod
def cap():
return ['a', 'b', 'c']
The first class gives the menu options for default template, while next gives for some other template.
I want another class OptionsMenu
derived from child class, and get the list (['a', 'b', 'c']
) and make changes to that.
Is this achievable in python? If yes, how may I achieve this?
Many thanks for any help!