From ea239fb8c60c12e8db051cb64fd09d74e1684bc3 2022-12-09 20:51:11 From: Jason Grout Date: 2022-12-09 20:51:11 Subject: [PATCH] Lint + change to f strings --- diff --git a/IPython/core/oinspect.py b/IPython/core/oinspect.py index 801cb88..bcaa95c 100644 --- a/IPython/core/oinspect.py +++ b/IPython/core/oinspect.py @@ -531,8 +531,8 @@ class Inspector(Colorable): """ defaults = { - 'text/plain': text, - 'text/html': '
' + html.escape(text) + '
' + "text/plain": text, + "text/html": f"
{html.escape(text)}
", } if formatter is None: @@ -543,10 +543,7 @@ class Inspector(Colorable): if not isinstance(formatted, dict): # Handle the deprecated behavior of a formatter returning # a string instead of a mime bundle. - return { - 'text/plain': formatted, - 'text/html': '
' + formatted + '
' - } + return {"text/plain": formatted, "text/html": f"
{formatted}
"} else: return dict(defaults, **formatted)