From 68287914e3613ded25f30c2ff501623fe52005b9 2018-01-18 11:00:08 From: Thomas Kluyver Date: 2018-01-18 11:00:08 Subject: [PATCH] Show raw code as plain text repr --- diff --git a/IPython/lib/display.py b/IPython/lib/display.py index 7263e29..6ebdc6c 100644 --- a/IPython/lib/display.py +++ b/IPython/lib/display.py @@ -590,6 +590,9 @@ class Code(TextDisplayObject): from pygments.lexers import guess_lexer return guess_lexer(self.data) + def __repr__(self): + return self.data + def _repr_html_(self): from pygments import highlight from pygments.formatters import HtmlFormatter