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)
| 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 |
nothing calls this directly
no test coverage detected