prettyprinter icon indicating copy to clipboard operation
prettyprinter copied to clipboard

feature request: ptpython extra

Open carlwgeorge opened this issue 6 years ago • 1 comments

I would love to see an integration for ptpython. Other people are interested too.

carlwgeorge avatar Feb 20 '19 15:02 carlwgeorge

I looked into the code in ptpython that prints evaluated values in the REPL. It's not very feasible to inject prettyprinter there right now. I left a comment about that in the issue you linked to (https://github.com/prompt-toolkit/ptpython/issues/153#issuecomment-465896922).

If you or someone else were to create a PR to ptpython to make the integration feasible, it shouldn't be too hard to provide the integration on the prettyprinter side. A minimum would be to have a single method on the ptpython.repl.PythonRepl class that handles printing the evaluated value, so that prettyprinter could monkeypatch that method with its own. A nicer integration would be through a configurable hook as a part of the ptpython public API.

tommikaikkonen avatar Feb 21 '19 07:02 tommikaikkonen