dotmap
dotmap copied to clipboard
_repr_mimebundle_ added to the keys if executed from IPython
Hi,
I have a weird behavior when I execute the below code in IPython console (I use IntelliJ interactive console):
from dotmap import DotMap
d = DotMap({'a': 3})
d
This returns:
DotMap(a=3, _repr_mimebundle_=DotMap())
And if I test the number of keys:
print(len(d))
I get 2
I cannot reproduce this behavior in regular console, only with IPython
I also got a similar behavior that includes not only _repr_minmebundle_ but also _ipython_display_ with iPython (version 8.1.0, Python 3.8.10)
@Kreol64 I found a workaround. Setting _dynamic=False does the trick.
from dotmap import DotMap
d = DotMap({'a': 3}, _dynamic=False)