Apr-28-2019, 01:56 PM
(This post was last modified: Apr-28-2019, 02:01 PM by Gribouillis.)
Nwb Wrote:Python doesn't just interpret line by line?No, python compiles code into a intermediary bytecode language. When this bytecode is loaded in memory, python creates "code object" instances, which are python objects. For every function that you define, there will be a code object. This code object contains the bytecode and various data such as the literal constants that are defined in the code. If there are literal integers 5000 in the function's body, python will create an integer instance stored in the code object and reuse the same instance no matter how many times you call the function.