MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / getsource

Function getsource

tools/python-3.11.9-amd64/Lib/inspect.py:1252–1259  ·  view source on GitHub ↗

Return the text of the source code for an object. The argument may be a module, class, method, function, traceback, frame, or code object. The source code is returned as a single string. An OSError is raised if the source code cannot be retrieved.

(object)

Source from the content-addressed store, hash-verified

1250 return getblock(lines[lnum:]), lnum + 1
1251
1252def getsource(object):
1253 """Return the text of the source code for an object.
1254
1255 The argument may be a module, class, method, function, traceback, frame,
1256 or code object. The source code is returned as a single string. An
1257 OSError is raised if the source code cannot be retrieved."""
1258 lines, lnum = getsourcelines(object)
1259 return ''.join(lines)
1260
1261# --------------------------------------------------- class tree extraction
1262def walktree(classes, children, parent):

Callers 1

_mainFunction · 0.85

Calls 2

getsourcelinesFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected