MCPcopy Index your code
hub / github.com/python/cpython / do_display

Method do_display

Lib/pdb.py:2316–2337  ·  view source on GitHub ↗

display [expression] Display the value of the expression if it changed, each time execution stops in the current frame. Without expression, list all display expressions for the current frame.

(self, arg)

Source from the content-addressed store, hash-verified

2314 complete_whatis = _complete_expression
2315
2316 def do_display(self, arg):
2317 """display [expression]
2318
2319 Display the value of the expression if it changed, each time execution
2320 stops in the current frame.
2321
2322 Without expression, list all display expressions for the current frame.
2323 """
2324 if not arg:
2325 if self.displaying:
2326 self.message('Currently displaying:')
2327 for key, val in self.displaying.get(self.curframe, {}).items():
2328 self.message('%s: %s' % (key, self._safe_repr(val, key)))
2329 else:
2330 self.message('No expression is being displayed')
2331 else:
2332 if err := self._compile_error_message(arg):
2333 self.error('Unable to display %s: %r' % (arg, err))
2334 else:
2335 val = self._getval_except(arg)
2336 self.displaying.setdefault(self.curframe, {})[arg] = val
2337 self.message('display %s: %s' % (arg, self._safe_repr(val, arg)))
2338
2339 complete_display = _complete_expression
2340

Callers

nothing calls this directly

Calls 8

messageMethod · 0.95
_safe_reprMethod · 0.95
errorMethod · 0.95
_getval_exceptMethod · 0.95
itemsMethod · 0.45
getMethod · 0.45
setdefaultMethod · 0.45

Tested by

no test coverage detected