Author rhettinger
Recipients bethard, dsuch, eric.araujo, paul.j3, rhettinger, tim.golden
Date 2019-08-30.06:15:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1567145740.93.0.276636761768.issue10190@roundup.psfhosted.org>
In-reply-to
Content
Marking this as out-of-date.  It seems that the desired functionality has already been added in types.SimpleNamespace:

    # Capabilities of _AttributeHolder
    >>> ah = _AttributeHolder()
    >>> ah
    AttributeHolder()
    >>> ah.raymond='Red'
    >>> ah
    AttributeHolder(raymond='Red')
    >>> ah.raymond
    'Red'
    >>> ah.rachel='blue'
    >>> ah
    AttributeHolder(rachel='blue', raymond='Red')
    >>> ah._get_kwargs()
    [('rachel', 'blue'), ('raymond', 'Red')]

    # Capabilities of SimpleNamespace
    >>> import types
    >>> ah = types.SimpleNamespace()
    >>> ah.raymond='Red'
    >>> ah
    namespace(raymond='Red')
    >>> ah.rachel='blue'
    >>> ah
    namespace(rachel='blue', raymond='Red')
    >>> vars(ah).items()
    dict_items([('raymond', 'Red'), ('rachel', 'blue')])
History
Date User Action Args
2019-08-30 06:15:40rhettingersetrecipients: + rhettinger, dsuch, bethard, tim.golden, eric.araujo, paul.j3
2019-08-30 06:15:40rhettingersetmessageid: <1567145740.93.0.276636761768.issue10190@roundup.psfhosted.org>
2019-08-30 06:15:40rhettingerlinkissue10190 messages
2019-08-30 06:15:40rhettingercreate