E
egbert
Normally you use setattr() if the name of the attribute is in a
namestring: But my attributes are lists or dictionaries, and I don't seem to be
able to use setattr anymore.
Now I use for a list something like:
operate on __dict__ directly.
Is that true ? And are there better solutions ?
egbert
namestring: But my attributes are lists or dictionaries, and I don't seem to be
able to use setattr anymore.
Now I use for a list something like:
But I have the impression that I am cheating, because users should notself.__dict__[namestring].append(value) and for a dictionary:
self.__dict__[namestring][keystring]=value
operate on __dict__ directly.
Is that true ? And are there better solutions ?
egbert