looking for standard/builtin dict-like data object

Chris Angelico rosuav at gmail.com
Tue Aug 11 00:09:51 EDT 2015


On Tue, Aug 11, 2015 at 1:40 PM, Cameron Simpson <cs at zip.com.au> wrote:
> I also thought the stdlib had some kind of "namespace" class with this kind
> of API, but I can't find it now:-(

It does - types.SimpleNamespace(). It accepts keyword arguments, and
will let you create more attributes on the fly (unlike a namedtuple).

ChrisA



More information about the Python-list mailing list