AttrDict fails when uniting regular dicts
What happened?
At the moment, AttrDict will fail to execute union if the merged object is a regular dictionary. This is despite the docstrings suggesting that this should be possible.
The cause is that we directly call other.keys_nested(), which is AttrDict exclusive. The solution is an additional check istype(other, AttrDict), and converting if False.
Which operating systems have you used?
- [ ] macOS
- [ ] Windows
- [X] Linux
Version
v0.7
Relevant log output
No response
We desperately want to move away from AttrDict (see #366) rather than constantly patching it. However, we haven't found an alternative that fits our needs.
@brynpickering I was looking at alternatives, and I found dotmap: https://github.com/drgrib/dotmap/tree/master
The only thing its missing is the "disallow overrides" feature we have, although I feel like we are always turning that off...
It has one disadvantage, though: it uses OrderedDict instead of just dict, which is slightly slower.
Hmm yeah, the others I found also have only one downside each, so it's three options each with one problem making them unsuitable as drop-in replacements 😄
I'll try to come up with a nice working alternative later, so let's keep this issue open for now.
(subclass of Box with union_no_override or something)