pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/ipython/ipython/pull/14150

ts/global-0bd78641c0a1f3e0.css" /> Add a 'text/plain' repr to Markdown and JSON by mizoru · Pull Request #14150 · ipython/ipython · GitHub
Skip to content

Add a 'text/plain' repr to Markdown and JSON#14150

Open
mizoru wants to merge 2 commits intoipython:mainfrom
mizoru:md-repr
Open

Add a 'text/plain' repr to Markdown and JSON#14150
mizoru wants to merge 2 commits intoipython:mainfrom
mizoru:md-repr

Conversation

@mizoru
Copy link
Copy Markdown

@mizoru mizoru commented Sep 2, 2023

Addresses this issue.

Comment on lines +605 to +607

def __repr__(self):
return self.data
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this !

Shouldn't the JSON text representation return something more like Json.dumps(self.data, indent=2) ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IDK how to make that optional for jsonlines or similar; so this is fine as-is imho

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless it could be __str__ instead of __repr__?

Copy link
Copy Markdown
Contributor

@westurner westurner Sep 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so that repr(Markdown('# h1')) still works, and won't display() default to Markdown.__str__ before Markdown.__repr__?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy