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 <rep...@bugs.python.org>
<http://bugs.python.org/issue12920>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to