Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no_list=True ... fails? #98

Open
flypenguin opened this issue May 12, 2023 · 0 comments
Open

no_list=True ... fails? #98

flypenguin opened this issue May 12, 2023 · 0 comments

Comments

@flypenguin
Copy link

i think this is a bug:

import dotty_dict
d = dotty_dict.dotty(no_list=True)
d["one.two"] = "three"     # works
d["one.2"] = "three"       # boom!!

immediate result:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/tm/.virtualenvs/backend/lib/python3.9/site-packages/dotty_dict/dotty_dict.py", line 198, in __setitem__
    set_to(self._split(key), self._data)
  File "/Users/tm/.virtualenvs/backend/lib/python3.9/site-packages/dotty_dict/dotty_dict.py", line 190, in set_to
    set_to(items, data[it])
  File "/Users/tm/.virtualenvs/backend/lib/python3.9/site-packages/dotty_dict/dotty_dict.py", line 194, in set_to
    self.set_list_index(data, it, value)
  File "/Users/tm/.virtualenvs/backend/lib/python3.9/site-packages/dotty_dict/dotty_dict.py", line 210, in set_list_index
    data.append(None)
AttributeError: 'dict' object has no attribute 'append'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant