On Wed, Dec 23, 2015 at 11:46 PM, Neal Becker <ndbeck...@gmail.com> wrote: > Sometimes I want to collect attributes on an object. Usually I would make > an empty class for this. But it seems unnecessarily verbose to do this. So > I thought, why not just use an Object? But no, an instance of Object > apparantly can't have an attribute. Is this intentional?
Yes; there are other uses of object() that benefit from being extremely compact. You can use types.SimpleNamespace for this job, or you can create the empty class as you're describing. (Chances are you can give the class a meaningful name anyway.) ChrisA -- https://mail.python.org/mailman/listinfo/python-list