cdgriffith / Box

Python dictionaries with advanced dot notation access
https://github.com/cdgriffith/Box/wiki
MIT License
2.61k stars 106 forks source link

Issue157 bug in box.setdefault #158

Closed NoamGraetz2 closed 4 years ago

NoamGraetz2 commented 4 years ago

when using box.setdefault with dict, it returned a 'detached' object that did not reflect changes on the original box i.e. if using b = a.setdefault('x', {}), updated to 'b' did not reflect to 'a'

simple fix. added test.

this is my 1st contribution, so if something is missing, please let me know

cdgriffith commented 4 years ago

Hi @NoamGraetz2 thanks for filing the bug and pull request!

I confirmed the tests are just not working because of code in dev and your additions are good, merging to develop and will have a release hopefully later today.

Thanks!