tommikaikkonen / prettyprinter

Syntax-highlighting, declarative and composable pretty printer for Python 3.5+
https://prettyprinter.readthedocs.io
MIT License
336 stars 20 forks source link

Hooking the built-in REPL #2

Closed njsmith closed 6 years ago

njsmith commented 6 years ago

The docs say:

Unfortunately, it’s not possible to override the representation printer for values evaluated in the default Python shell. I recommend using IPython.

I also recommend using IPython, but is there some reason sys.displayhook won't work?

tommikaikkonen commented 6 years ago

I didn't know that existed! In that case, I'll certainly write an integration for it :) Thanks.

tommikaikkonen commented 6 years ago

Fixed in https://github.com/tommikaikkonen/prettyprinter/commit/57bc4213e931cf6e24d41950f7cb1ba538a883d1 which is available in the 0.5.0 release that I just uploaded on PyPi 👍