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

Method hidden_frames

IPython/core/debugger.py:291–308  ·  view source on GitHub ↗

Given an index in the stack return wether it should be skipped. This is used in up/down and where to skip frames.

(self, stack)

Source from the content-addressed store, hash-verified

289
290
291 def hidden_frames(self, stack):
292 """
293 Given an index in the stack return wether it should be skipped.
294
295 This is used in up/down and where to skip frames.
296 """
297 # The f_locals dictionary is updated from the actual frame
298 # locals whenever the .f_locals accessor is called, so we
299 # avoid calling it here to preserve self.curframe_locals.
300 # Futhermore, there is no good reason to hide the current frame.
301 ip_hide = [
302 False if s[0] is self.curframe else s[0].f_locals.get(
303 "__tracebackhide__", False)
304 for s in stack]
305 ip_start = [i for i, s in enumerate(ip_hide) if s == "__ipython_bottom__"]
306 if ip_start:
307 ip_hide = [h if i > ip_start[0] else True for (i, h) in enumerate(ip_hide)]
308 return ip_hide
309
310 def interaction(self, frame, traceback):
311 try:

Callers 3

print_stack_traceMethod · 0.95
do_upMethod · 0.95
do_downMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected