Expose a _simpler_ way to get raw object reprs
See original GitHub issueThis came up in several contexts, @mpacer for subfigure and @rgbkrk who want to have list(objects) have rich reprs.
We can’t call _repr_*_
recursively as it may not be defined (user custom reprs, or repr_mimebundle).
and get_ipython().display_formatter.format
is bit verbose/hidden.
I propose a small wrapper around get_ipython().display_formatter.format
, which is exposed and return the repr of an object. It has to likely have some logic to check for re-entrancy (like repr pretty) and avoid recursion.
Thoughts ?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:27 (27 by maintainers)
Top Results From Across the Web
What is the difference between __str__ and __repr__?
The use of eval(repr(obj)) is a sanity test and a rule of thumb - if this recreates the original object correctly then you...
Read more >Simple Effective Ways to Care for Skin Wounds and Incisions
Go to: DO NOT LET EXPOSED RAW TISSUES DRY AND DIE. KEEP RAW WOUNDS CLEAN AND GREASY. How to Clean Raw Wounds?
Read more >Simple Object Designer – Expose data as API endpoints
With the Simple Object Designer, it's possible to expose data as API endpoints. Microsoft is working hard to make API endpoint the primary...
Read more >How to Build a Simple REST API in PHP - Code
In this article, we'll build a simple demo application, which allows you to fetch a list of users from the MySQL database via...
Read more >Secrets
A Secret is an object that contains a small amount of sensitive data such as a password, a token, or a key. Such...
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 Free
Top 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
With JupyterLab we are working hard to provide a lot of clarity about what things are public APIs and which things are not. The approach (how it turned out) in the classic notebook was to have users directly modify the DOM and target our CSS classes in extensions. The difficulty with that is that essentially makes your DOM structure and CSS classes public APIs, which is overly constraining from a maintenance perspective. With Lab, our policy is that the DOM structure and CSS classes are entirely private. As Kyle mentioned, this type of thing also makes it difficult for other frontends to cover these cases.
I agree with Kyle that if we were to ever standardize on DOM structure or CSS classes, it would need to be in both specs (nbformat, message spec). However, I don’t think that is the best way to get something like this working across frontends. Some other options:
I prefer any/all of these over the CSS class standardization.
On Wed, Jun 14, 2017 at 4:44 PM, Brian Granger ellisonbg@gmail.com wrote:
– Brian E. Granger Associate Professor of Physics and Data Science Cal Poly State University, San Luis Obispo @ellisonbg on Twitter and GitHub bgranger@calpoly.edu and ellisonbg@gmail.com
Thanks, I was not at all speaking of already existing class, currently existing DOM structures, or of Dom even structures created by the frontend. The above example cannot be rendered only by a tree rendered that handle json. Creating a new mimetype does not work either. And “Well scoped” css cannot work cleanly either with current architecture as each leaf node would have to display a duplicate of the 80 line css fixes to render identically on Lab/Nteract/Classic.