How to use the addict.addict.Dict function in addict

To help you get started, we’ve selected a few addict examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mewwts / addict / addict / addict.py View on Github external
def __setitem__(self, name, value):
        super(Dict, self).__setitem__(name, value)
        try:
            p = object.__getattribute__(self, '__parent')
            key = object.__getattribute__(self, '__key')
        except AttributeError:
            p = None
            key = None
        if p is not None:
            p[key] = self
            object.__delattr__(self, '__parent')
            object.__delattr__(self, '__key')

addict

Addict is a dictionary whose items can be set using both attribute and item syntax.

MIT
Latest version published 4 years ago

Package Health Score

73 / 100
Full package analysis