why i can't get the sourcecode with inspect module?

Steven D'Aprano steve at pearwood.info
Wed Aug 20 01:00:24 EDT 2014


On Wed, 20 Aug 2014 11:05:26 +0800, luofeiyu wrote:

>>>> import inspect
>  >>> def changer(x,y):
> ...     return(x+y)


The interactive interpreter doesn't store the source code you type. It 
compiles it to byte-code, executes the byte-code, and throws the source 
code away.


-- 
Steven



More information about the Python-list mailing list