cdgriffith / Box

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

[5.0.0] Spurious values appear in default Box "repr" #155

Closed richieadler closed 4 years ago

richieadler commented 4 years ago
>>> b = box.Box(default_box=True)
>>> b
<Box: {}>
>>> b.first = ''
>>> b
<Box: {'_obj_': {}, '_oleobj_': {'GetTypeInfoCount': {}}, 'first': ''}>
>>> dict(b)
{'_obj_': <Box: {}>, '_oleobj_': <Box: {'GetTypeInfoCount': {}}>, 'first': ''}
cdgriffith commented 4 years ago

Thanks for the fast report!

This is due to some interpreters doing checks for methods existing, and being saved. I am adding a fix that will at least exclude them being saved as long as they start and end with underscores, as most should be restricted properties or magic methods I hope.

Being fixed now in 5.0.1