This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark
Recipients mark
Date 2014-08-02.08:02:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1406966548.11.0.912987884229.issue22123@psf.upfronthosting.co.za>
In-reply-to
Content
Right now object() does not accept any args and returns the lightest possible featureless object (i.e., without even a __dict__).

This is great.

However, it is really useful sometimes to be able to create an object to hold some editable state (so not a namedtuple). Right now this can be done with types.SimpleNamespace().

I think it would be a useful enhancement to have object() work as it does now, but to allow it to accept kwargs in which case it would provide identical functionality to types.SimpleNamespace().

This arises from an email I wrote to the python mailinglist:
https://groups.google.com/d/msg/comp.lang.python/9pY7hLp8lDg/voYF8nMO6x8J

But I also think it would be useful more generally.
History
Date User Action Args
2014-08-02 08:02:28marksetrecipients: + mark
2014-08-02 08:02:28marksetmessageid: <1406966548.11.0.912987884229.issue22123@psf.upfronthosting.co.za>
2014-08-02 08:02:28marklinkissue22123 messages
2014-08-02 08:02:27markcreate