[docs] [issue12920] inspect.getsource only works for objects loaded from files, not interactive session
report at bugs.python.org
Wed Jun 24 07:45:05 CEST 2015
Zorceta added the comment:
When provided object is not from a file, like input in interactive shell, `inspect` internals will check for it in `linecache`, which official Python shell and IDLE won't put interactive shell input into, yet. This can be simply solved.
Whether interactive shell input can be put into `linecache` may be a problem, but it'll make life easier, as interactive shell saves time from edit-save-run 'loop'.
btw, I changed the title, since I don't think, what original author thought need to be documented, is absolutely right.
title: Document that inspect.getsource only works for objects loaded from files, not interactive session -> inspect.getsource only works for objects loaded from files, not interactive session
Python tracker <report at bugs.python.org>
More information about the docs