You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See below; keys that start with __ can't be referenced inside an object with dotted notation. If I defined missing() I get "KeyError: '_Stuff__metadata'".
Thanks for this awesome piece of software BTW -- makes my life much better.
-- cut here --
import addict
from pprint import pformat
See below; keys that start with __ can't be referenced inside an object with dotted notation. If I defined missing() I get "KeyError: '_Stuff__metadata'".
Thanks for this awesome piece of software BTW -- makes my life much better.
-- cut here --
import addict
from pprint import pformat
data = {
'foo': 7,
'bar': {
'metadata': {'text': 'this works', 'value': True},
'__metadata': {'text': 'this works', 'value': False}
}
}
dotted = addict.Dict(data)
class Stuff(object):
def init(self):
pass
assert dotted.bar.metadata.text == dotted.bar.__metadata.text, 'broken outside an object'
Stuff().run()
The text was updated successfully, but these errors were encountered: