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

Method getsourcelines

IPython/core/debugger.py:563–570  ·  view source on GitHub ↗
(self, obj)

Source from the content-addressed store, hash-verified

561 do_l = do_list
562
563 def getsourcelines(self, obj):
564 lines, lineno = inspect.findsource(obj)
565 if inspect.isframe(obj) and obj.f_globals is obj.f_locals:
566 # must be a module frame: do not try to cut a block out of it
567 return lines, 1
568 elif inspect.ismodule(obj):
569 return lines, 1
570 return inspect.getblock(lines[lineno:]), lineno+1
571
572 def do_longlist(self, arg):
573 """Print lines of code from the current stack frame.

Callers 2

do_longlistMethod · 0.95
find_source_linesFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected