Synchronize `__repr__()` and `_repr_html_()`
See original GitHub issueTIL that Info
has a dedicated HTML representation, which is 🔥. However, I don’t like that it doesn’t show the same information as the standard text representation, for example:
Specifically, I really miss the channel names and I don’t like that MEG types are always listed, but ideally there should be no differences at all except for a nicer rendering in HTML. WDYT?
Issue Analytics
- State:
- Created 2 years ago
- Comments:46 (46 by maintainers)
Top Results From Across the Web
8.19. repr — Alternate repr() implementation - Python 2.7 ...
Class which provides formatting services useful in implementing functions similar to the built-in repr(); size limits for different object types are added to ......
Read more >8.19. repr — Alternate repr() implementation - Python
Class which provides formatting services useful in implementing functions similar to the built-in repr(); size limits for different object types are added ...
Read more >Untitled
A Repr is a structured representation of a value of that can be rendered into various human readbale formats. Self Type: Repr. Linear...
Read more >python - IPython _repr_html_ - Stack Overflow
I really like how in the IPython Notebook you can add a class method called _repr_html_() to print a rich HTML version of...
Read more >str() vs repr() in Python - GeeksforGeeks
'Hello, Geeks.' 0.18181818181818182. From above output, we can see if we print string using repr() function then it prints with a pair of ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
No strong feeling from me. With the HTML we might be able to get away with more information even if we try to make it more consistent, for example we could probably do a 3-column table that has key / description / value (currently it’s description / value), and keep the console more compact and closer to code with just key / value (what it is now).
Since @hoechenberger mentioned scikit-learn pipelines, they have a config option where users can choose which repr is shown: https://scikit-learn.org/dev/auto_examples/miscellaneous/plot_pipeline_display.html#sphx-glr-auto-examples-miscellaneous-plot-pipeline-display-py
I think this would be a very nice solution where all of us would be happy.