Customizable hook for pinfo (?) akin to _ipython_display_

Open
#1,005 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
jupyter, python
Domain
tooling

Research direction

Start by reading the pinfo magic and the existing ipython_display behavior. Clarify how a customization hook should work for both classes and instances, using the related JupyterLab issue for context. Done means calling ? on supported objects can use their custom informational output.

Written by the indexing model from the issue text.

Description

[Related to https://github.com/jupyterlab/jupyterlab/issues/13217]

This is mostly applicable to working in a notebook or lab environment, but I would like to be able to customize what happens when I call ? on the classes and objects in the libraries I write. This kind of hook already exists for displaying objects through _ipython_display_ and now I would just like it to also work for calling like ?MyNiceClass

In principle, this should be easy as ? just calls into the pinfo magic which could check for the existence of some hook like _ipython_pinfo_ or something similar, although two variants might be required, one for instances and one for classes

Dominant language
Python
Stars
734
Forks
411
Avg merge
1d 2h
Merged PRs (30d)
9

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ipython/ipykernel

All issues in ipython/ipykernel

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.