Hi,
I need to dynamically create class attributes from a DEFAULTS dictionary.
defaults = {
'default_value1':True,
'default_value2':True,
'default_value3':True,
}
class Settings(object):
default_value1 = some_complex_init_function(defaults[default_value1], ...)
default_value2 = some_complex_init_function(defaults[default_value2], ...)
default_value3 = some_complex_init_function(defaults[default_value3], ...)
I could also achive this by having sth. like __init__
for class creation, in order to dynamically create these attributes from dictionary and save a lot of code and stupid work.
How would you do this?
Thank you very much in advance!