How can I create an object and add attributes to it?
The built-in object can be instantiated but can’t have any attributes set on it. (I wish it could, for this exact purpose.) It doesn’t have a __dict__ to hold the attributes. I generally just do this: class Object(object): pass a = Object() a.somefield = somevalue When I can, I give the Object class a more … Read more