MCPcopy Index your code
hub / github.com/ipython/ipython / _get_frame_locals

Method _get_frame_locals

IPython/core/debugger.py:649–669  ·  view source on GitHub ↗

" Accessing f_local of current frame reset the namespace, so we want to avoid that or the following can happen ipdb> foo "old" ipdb> foo = "new" ipdb> foo "new" ipdb> where ipdb> foo "old" So if frame is self.

(self, frame)

Source from the content-addressed store, hash-verified

647 super()._pdbcmd_print_frame_status(arg) # type: ignore[misc]
648
649 def _get_frame_locals(self, frame):
650 """ "
651 Accessing f_local of current frame reset the namespace, so we want to avoid
652 that or the following can happen
653
654 ipdb> foo
655 "old"
656 ipdb> foo = "new"
657 ipdb> foo
658 "new"
659 ipdb> where
660 ipdb> foo
661 "old"
662
663 So if frame is self.current_frame we instead return self.curframe_locals
664
665 """
666 if frame is self.curframe:
667 return self.curframe_locals
668 else:
669 return frame.f_locals
670
671 def format_stack_entry(
672 self,

Callers 5

_hidden_predicateMethod · 0.95
format_stack_entryMethod · 0.95
getsourcelinesMethod · 0.95
break_anywhereMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected