Python object question about __setattr__ and __getattr__.
Okay, I’m making a mock “object-like” object out of a dict. Details should be pretty much irrelevant. The behavior that I want is like this: o = ObjectLike() # Here, we construct and assign arbitrary nested objects of # type ObjectLike. o.foo.bar.baz = ‘something’ # We can see the nested objects: print o.foo <__main__.ObjectLike object [...]
Continue Reading →