Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_repr_mimebundle_ added to the keys if executed from IPython #73

Open
Kreol64 opened this issue Jan 21, 2021 · 2 comments
Open

_repr_mimebundle_ added to the keys if executed from IPython #73

Kreol64 opened this issue Jan 21, 2021 · 2 comments

Comments

@Kreol64
Copy link

Kreol64 commented Jan 21, 2021

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

@terasakisatoshi
Copy link

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)

@terasakisatoshi
Copy link

@Kreol64 I found a workaround. Setting _dynamic=False does the trick.

from dotmap import DotMap
d = DotMap({'a': 3}, _dynamic=False) 

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants