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

Deprecate %params line magic #1000

Open
maximlt opened this issue Jan 2, 2025 · 2 comments
Open

Deprecate %params line magic #1000

maximlt opened this issue Jan 2, 2025 · 2 comments
Labels
status: discussion Discussion. Not yet a specific feature/bug. Likely to result in multiple PRs/issues.

Comments

@maximlt
Copy link
Member

maximlt commented Jan 2, 2025

I had completely forgotten param provided the %params line magic for IPython.

Image

%params is not documented on the website. I'm in favor of deprecating it, although there's a catch. While I think the HTML repr is a better alternative in a notebook, there would no longer be an easy way to display the custom IPython repr in an IPython console (print(param.parameterized.param_pager(<obj>))); <obj>? displays the class docstring and not the current values of the instance.

From a quick search, implementing _repr_pretty_ seems to be the way for an object to have both a fancier IPython repr and an HTML repr (already implemented with _repr_html_). I think that would mean that the implementation wouldn't be as a pager (https://ipython.readthedocs.io/en/8.26.0/api/generated/IPython.lib.pretty.html) but I'm not sure to which extent the pager is useful, is the repr long enough to justify it?

@maximlt maximlt added the status: discussion Discussion. Not yet a specific feature/bug. Likely to result in multiple PRs/issues. label Jan 2, 2025
@philippjfr
Copy link
Member

+100

@jbednar
Copy link
Member

jbednar commented Jan 3, 2025

Personally, I really dislike magics and moderately dislike pagers, so I'm all in favor!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: discussion Discussion. Not yet a specific feature/bug. Likely to result in multiple PRs/issues.
Projects
None yet
Development

No branches or pull requests

3 participants