python-attributedict
python-attributedict copied to clipboard
Bug with `x.y` style dictionary keys
Error trace:
>>> data = AttributeDict({'foo': {'bar': [1, 2, 3]}, 'this.test': 1})
>>> data['this.test']
1
>>> data.this.test
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/gamesbook/.venvs/attr/local/lib/python2.7/site-packages/attributedict/collections.py", line 226, in __getattr__
raise AttributeError(error)
AttributeError: 'this'
@gamesbook Thanks for adding this feature request. The library don't have official support for "flat keys" but was listed as a potential feature addition eventually: https://github.com/grimen/python-attributedict/issues/1
I am not sure if I will add support for it or not, as I don't have much usage for it at this time.