param icon indicating copy to clipboard operation
param copied to clipboard

Deprecate %params line magic

Open maximlt opened this issue 11 months ago • 2 comments

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 avatar Jan 02 '25 12:01 maximlt

+100

philippjfr avatar Jan 02 '25 14:01 philippjfr

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

jbednar avatar Jan 03 '25 19:01 jbednar