MCPcopy
hub / github.com/pallets/werkzeug / displayhook

Method displayhook

src/werkzeug/debug/console.py:79–89  ·  view source on GitHub ↗
(obj: object)

Source from the content-addressed store, hash-verified

77
78 @staticmethod
79 def displayhook(obj: object) -> None:
80 try:
81 stream = _stream.get()
82 except LookupError:
83 return _displayhook(obj) # type: ignore
84
85 # stream._write bypasses escaping as debug_repr is
86 # already generating HTML for us.
87 if obj is not None:
88 _ipy.get().locals["_"] = obj
89 stream._write(debug_repr(obj))
90
91 def __setattr__(self, name: str, value: t.Any) -> None:
92 raise AttributeError(f"read only attribute {name}")

Callers

nothing calls this directly

Calls 3

debug_reprFunction · 0.85
_writeMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected