Re: How does one view the source of function defined in the interpreter?

2009-01-29 Thread Terry Reedy
mattc wrote: Once the interpreter reads lines of code, then, as far as the interpreter is concerned, they are gone. 3) One last thing, is there any documentation for augmenting, extending, or editing a function in the interpreter once it is defined? Use IDLE, edit code in an edit window, the

How does one view the source of function defined in the interpreter?

2009-01-29 Thread mattc
1) It appears that it is possible to view the source of a function defined in the interpreter; however, I seem to be unable to do it. Here is the code and resulting error. >>> def f(): print("hello world") >>> f >>> f() hello world >>> import inspect >>> inspect >>> inspect.getsourcelin