Skip to content

Documentation for _repr_pretty_ is confusing #12992

Description

@terrdavis

The documentation for _repr_pretty_ at the end of the Rich Display section is confusing. It was never clear to me that this particular method was applicable in a different context than the _ipython_display_ and other _repr_* methods.

Though the paragraph starts with

To customize how the REPL pretty-prints your object[...]

the the notebook/QTConsole-specific methods use the same naming convention, and the entire rest of the section is dedicated non-REPL usage.

I would like to update the documentation to make the distinction clearer. Here are a couple possible improvements:

  1. Create separate sub-sections for REPL and non-REPL display methods;
  2. Put _repr_pretty_ first, and reword the next section to say that the other methods are available in addition to _repr_pretty_ when using IPython outside of the REPL.

Would it be possible to backport this change to other versions as well?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions