Issue 24491: inspect.getsource can't get source code if provided function isn't from a file

Issue24491

Created on 2015-06-23 16:46 by zorceta, last changed 2022-04-11 14:58 by admin. 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
2022-04-11 14:58:18adminsetgithub: 68679
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