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_html_ exception reporting corner case when using type(foo) #4990

Closed
ghost opened this issue Feb 2, 2014 · 1 comment · Fixed by #4996
Closed

_repr_html_ exception reporting corner case when using type(foo) #4990

ghost opened this issue Feb 2, 2014 · 1 comment · Fixed by #4996
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Feb 2, 2014

@michaelaye reported this in pandas-dev/pandas#6225,
but it seems to be an ipython issues, resulting from the recent #4745.

In [11]: class Foo(object):
    ...:     def _repr_html_(self):
    ...:         return "Me"
    ...: x=Foo()
In [12]: type(x)
/home/user1/src/ipython/IPython/core/formatters.py:199: FormatterWarning: 
Exception in text/html formatter: unbound method _repr_html_() must 
be called with Foo instance as first argument (got nothing instead)
  FormatterWarning,
@takluyver
Copy link
Member

Looks like we check for the existence of a _repr_foo_ attribute, but not whether it can be called with no arguments.

minrk added a commit to minrk/ipython that referenced this issue Feb 2, 2014
minrk added a commit to minrk/ipython that referenced this issue Feb 9, 2014
minrk added a commit to minrk/ipython that referenced this issue Feb 9, 2014
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant