Let's say I have the following class
class Parent(object):
Options = {
'option1': 'value1',
'option2': 'value2'
}
And a subclass called Child
class Child(Parent):
Options = Parent.Options.copy()
Options.update({
'option2': 'value2',
'option3': 'value3'
})
I want to be able to override or add options in the child class. The solution I'm using works. But I'm sure there is a better way of doing it.
EDIT
I don't want to add options as class attributes because I have other class attributes that aren't options and I prefer to keep all options in one place. This is just a simple example, the actual code is more complicated than that.