classification
Title: inspect.getsource can't get source code if provided function isn't from a file
Type: behavior Stage: resolved
Components: Versions: Python 3.4
process
Status: closed Resolution: duplicate
Dependencies: Superseder: inspect.getsource only works for objects loaded from files, not interactive session
View: 12920
Assigned To: Nosy List: ned.deily, zorceta
Priority: normal Keywords:

Created on 2015-06-23 16:46 by zorceta, last changed 2015-06-24 04:04 by ned.deily. This issue is now closed.

Messages (2)
msg245694 - (view) Author: Zorceta (zorceta) Date: 2015-06-23 16:46
Both python.exe and IDLE can't. IPython is able to, as it inserts REPL input into linecache.
msg245715 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2015-06-24 04:04
Issue12920 is currently open with a suggestion to change the documentation for inspect.getsource.
History
Date User Action Args
2015-06-24 04:04:41ned.deilysetstatus: open -> closed

superseder: inspect.getsource only works for objects loaded from files, not interactive session

nosy: + ned.deily
messages: + msg245715
resolution: duplicate
stage: resolved
2015-06-23 16:46:56zorcetacreate