Can class attributes be set dynamically?
Something like this:
class MyConstants:
GLOBAL_VAR = 'actual_attr_name'
class MyStrings:
setattr(cls, MyConstants.GLOBAL_VAR, None)
I wish to automate setting a number of class attributes, for which I don't know/want to hardcode their names... instead fetch them from another class. The snipped above returns
NameError: name 'cls' is not defined