Open irm-codebase opened 3 months ago
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)
What happened?
At the moment,
AttrDict
will fail to executeunion
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 isAttrDict
exclusive. The solution is an additional checkistype(other, AttrDict)
, and converting ifFalse
.Which operating systems have you used?
Version
v0.7
Relevant log output
No response