[issue12920] Document that inspect.getsource only works for objects loaded from files, not interactive session

2015-06-23 Thread Ned Deily
Ned Deily added the comment: In duplicate Issue24491, zorceta notes: "Both python.exe and IDLE can't. IPython is able to, as it inserts REPL input into linecache." -- nosy: +ned.deily, zorceta versions: +Python 3.5, Python 3.6 -Python 3.2, Python 3.3 ___

[issue12920] Document that inspect.getsource only works for objects loaded from files, not interactive session

2013-03-24 Thread Éric Araujo
Éric Araujo added the comment: > It seems to work perfectly on command line though. If the code is saved in a file, yes, but not in an interactive interpreter. This is not actually related to IDLE, but to the fact that inspect.getsource merely finds the __file__ attribute of the module object