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)
| 1177 | return getblock(lines[lnum:]), lnum + 1 |
| 1178 | |
| 1179 | def getsource(object): |
| 1180 | """Return the text of the source code for an object. |
| 1181 | |
| 1182 | The argument may be a module, class, method, function, traceback, frame, |
| 1183 | or code object. The source code is returned as a single string. An |
| 1184 | OSError is raised if the source code cannot be retrieved.""" |
| 1185 | lines, lnum = getsourcelines(object) |
| 1186 | return ''.join(lines) |
| 1187 | |
| 1188 | # --------------------------------------------------- class tree extraction |
| 1189 | def walktree(classes, children, parent): |
no test coverage detected
searching dependent graphs…