MCPcopy Index your code
hub / github.com/RustPython/RustPython / do_source

Method do_source

Lib/pdb.py:1275–1288  ·  view source on GitHub ↗

source expression Try to get source code for the given object and display it.

(self, arg)

Source from the content-addressed store, hash-verified

1273 do_ll = do_longlist
1274
1275 def do_source(self, arg):
1276 """source expression
1277 Try to get source code for the given object and display it.
1278 """
1279 try:
1280 obj = self._getval(arg)
1281 except:
1282 return
1283 try:
1284 lines, lineno = getsourcelines(obj)
1285 except (OSError, TypeError) as err:
1286 self.error(err)
1287 return
1288 self._print_lines(lines, lineno)
1289
1290 complete_source = _complete_expression
1291

Callers

nothing calls this directly

Calls 4

_getvalMethod · 0.95
errorMethod · 0.95
_print_linesMethod · 0.95
getsourcelinesFunction · 0.70

Tested by

no test coverage detected