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

Sub-dicts with falsy value can be lost #88

Closed
bmerry opened this issue Mar 4, 2017 · 3 comments
Closed

Sub-dicts with falsy value can be lost #88

bmerry opened this issue Mar 4, 2017 · 3 comments

Comments

@bmerry
Copy link

bmerry commented Mar 4, 2017

In 2.0.0:

>>> from addict import Dict
>>> a[0].x = 1
>>> print(a)
{}

This is because this line tests for key being true, for no good reason that I can see.

@mewwts
Copy link
Owner

mewwts commented Mar 5, 2017

This should now be fixed 🥇

@mewwts mewwts closed this as completed Mar 5, 2017
@bmerry
Copy link
Author

bmerry commented Mar 5, 2017

Looking at the code, I suspect a[None].x = 1 will still fail. I'm not seeing why the key is not None test is needed at all.

@mewwts
Copy link
Owner

mewwts commented Mar 5, 2017

You're right! In my head None was unhashable, but it's not. Editing....

mewwts added a commit that referenced this issue Mar 5, 2017
mewwts added a commit that referenced this issue Mar 5, 2017
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

2 participants