Skip to content

Output on objects defining _ipython_display_ #10491

@TomAugspurger

Description

@TomAugspurger

I have a usage question / maybe API enhancement request about _ipython_display_. I noticed today that objects defining a _ipython_display_ method don't seem to be able to trigger the Out[n] machinery for the output of a cell. Here's an example notebook Notice that the In[5] doesn't have an Out[5].

Is there any way in _ipython_display_ to say "treat this one as the return value". Should IPython treat the highest-priority one as the return value?

This came up in a pandas issue pandas-dev/pandas#16168 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions