Feb-26-2017, 09:49 AM (This post was last modified: Feb-26-2017, 10:19 AM by buran.)
(Feb-26-2017, 03:28 AM)Skaperen Wrote: interesting that self.foo = 1 can create a new attribute in a class instance but setattr() is needed in other cases.
What do you mean?
self.foo = 1
and setattr(self, foo, 1)
would yield the same result