MCPcopy Create free account
hub / github.com/ipython/ipython / _safe_repr

Function _safe_repr

IPython/core/formatters.py:206–214  ·  view source on GitHub ↗

Try to return a repr of an object always returns a string, at least.

(obj)

Source from the content-addressed store, hash-verified

204
205
206def _safe_repr(obj):
207 """Try to return a repr of an object
208
209 always returns a string, at least.
210 """
211 try:
212 return repr(obj)
213 except Exception as e:
214 return "un-repr-able object (%r)" % e
215
216
217class FormatterWarning(UserWarning):

Callers 1

_check_returnMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected