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
get _ipython_display_ method safely #5229
Conversation
Cool. This PR is working for me. |
@@ -64,7 +64,9 @@ def _valid_formatter(f): | |||
- unbound methods NO | |||
- callable with zero args OK | |||
""" | |||
if isinstance(f, type(str.find)): | |||
if f is None: | |||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return False
, to keep the API consistent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, that's because I moved the clause from the new function below. Good catch, fixed.
Other than that, looks good. |
use the same method we use for `_repr_foo_`
Yep, LGTM too... |
get _ipython_display_ method safely
Hi, this only works if the returned object is not callable. Is there a way to tell IPython to avoid trying to use that method at all (or on some classes/objects)? |
get _ipython_display_ method safely
use the same method we use for
_repr_foo_
closes #5227