Understanding how Python “Compiles” or “Interprets” Function Objects
问题 I have read the following posts but I am still unsure of something. Python Compilation/Interpretation Process Why python compile the source to bytecode before interpreting? If I have a single Python file myfunctions.py containing the following code. x = 3 def f(): print x x = 2 Then, saying $ python myfunctions.py runs perfectly fine. But now make one small change to the above file. The new file looks as shown below. x = 3 def f(): print x x = 2 f() # there is a function call now This time,