How many times inner functions are compiled ?

Gordon McMillan gmcm at hypernet.com
Tue Jun 13 08:21:52 EDT 2000


Jerome Quelin wrote: 

>def outer():
>    def inner():
>        print "spam"
>    inner()
>outer()
>outer()

>In the snippet code above, I call outer() two times. I would like to
>know how many times python will compile the inner function ? 

Every time you call outer().


- Gordon



More information about the Python-list mailing list