Skip to content

Bug with x.y style dictionary keys #7

Open

Description

@gamesbook

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'

Activity

  1. self-assigned this
    on May 24, 2019
  2. grimen commented on May 24, 2019

    @grimen
    Owner

    @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: #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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions