question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Synchronize `__repr__()` and `_repr_html_()`

See original GitHub issue

TIL 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: Screen Shot 2021-10-11 at 15 50 49 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:closed
  • Created 2 years ago
  • Comments:46 (46 by maintainers)

github_iconTop GitHub Comments

3reactions
larsonercommented, Oct 11, 2021

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).

2reactions
cbrnrcommented, Oct 14, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found