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)
| 1250 | return getblock(lines[lnum:]), lnum + 1 |
| 1251 | |
| 1252 | def 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 |
| 1262 | def walktree(classes, children, parent): |
no test coverage detected